如何在OEL6 OCI映像上安装iproute2

时间:2019-03-22 20:49:42

标签: oracle-cloud-infrastructure

我需要在OCI的OEL6图像中使用ip l2tp。我无法获得较新版本的iproute2,因为我所拥有的没有ip l2tp:

Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |
                   tunnel | maddr | mroute | mrule | monitor | xfrm | token 
}
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec |
                    -f[amily] { inet | inet6 | ipx | dnet | link } |
                    -o[neline] | -t[imestamp] | -b[atch] [filename] |
                    -rc[vbuf] [size]}

我有以下版本:

rpm -qi iproute
Name        : iproute                      Relocations: (not relocatable)
Version     : 2.6.32                            Vendor: Oracle America
Release     : 57.0.1.el6                    Build Date: Tue 01 May 2018 07:11:37 PM GMT
Install Date: Fri 22 Feb 2019 12:50:48 AM GMT      Build Host: x86-ol6-builder-04.us.oracle.com
Group       : Applications/System           Source RPM: iproute-2.6.32-57.0.1.el6.src.rpm
Size        : 964229                           License: GPLv2+ and Public Domain
Signature   : RSA/8, Tue 01 May 2018 07:11:56 PM GMT, Key ID 72f97b74ec551f03
URL         : http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
Summary     : Advanced IP routing and network device configuration tools
Description :
The iproute package contains networking utilities (ip and rtmon, for
example) which are designed to use the advanced networking
capabilities of the Linux 2.4.x and 2.6.x kernel.

我升级了所有软件包:

yum update
Loaded plugins: security, ulninfo
Setting up Update Process
No Packages marked for Update

我下载了最新版本的iproute2:  wget https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-5.0.0.tar.gz

我尝试编译它:

make

lib
    CC       libgenl.o
In file included from ../include/uapi/linux/kernel.h:5,
                 from ../include/uapi/linux/netlink.h:5,
                 from ../include/uapi/linux/genetlink.h:6,
                 from libgenl.c:10:
../include/uapi/linux/sysinfo.h:9: error: expected specifier-qualifier-list before ‘__kernel_long_t’
make[1]: *** [libgenl.o] Error 1
make: *** [all] Error 2

寻找错误我偶然发现: https://patchwork.ozlabs.org/patch/843454/

有什么想法如何获得iproute2吗?

谢谢你,

1 个答案:

答案 0 :(得分:2)

这是升级它的快速方法。

  1. 查看当前版本:
$ ip -V
ip utility, iproute2-ss091226
  1. 创建一个引用OL6 OpenStack 1.0 repo的新文件并添加存储库(这是我使用的内容):
$ cat /etc/yum.repos.d/oracle-openstack-ol6.repo
[ol6_openstack10]
name=Oracle Linux $releasever OpenStack 1.0 ($basearch)
baseurl=http://yum$ociregion.oracle.com/repo/OracleLinux/OL6/openstack10/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
  1. 运行sudo yum update(您应该在更新的软件包列表中看到iproute
  2. 确认版本已更改:
$ ip -V
ip utility, iproute2-ss130221
  1. 最后,您可以检查l2tp是否现在列出(我的列表是否已列出-在下面复制):
$ ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |
                   netns | l2tp | tcp_metrics }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |
                    -l[oops] { maximum-addr-flush-attempts } |
                    -o[neline] | -t[imestamp] | -b[atch] [filename] |
                    -rc[vbuf] [size]}