1

我需要在 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?

谢谢你,C。

4

1 回答 1

2

这是升级它的快速方法。

  1. 查看当前版本:
$ ip -V
ip utility, iproute2-ss091226
  1. 创建一个引用OL6 OpenStack 1.0 存储库的新文件并添加存储库(这是我使用的内容):
$ 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]}
于 2019-03-25T21:59:36.103 回答