天天看点

两台设备之间建立多条gre通道.

过程有点儿复杂. 共分为三个部分.

第一部分.

我用一台多IP地址的linux与对端网络设备相建立两条gre通道.

我得出了下面的结论.

就算是指定本机不同的 local IP 与对端建立第二条通道. 通道也建立不起来. 但执行命令时并不会有出错提示.

如果使用 ip tunnel change来改变原有虚接口的 remote也是一样. 如果对端IP已经出现. 修改是不会成功的. 命令执行时也没有出错信息.

第二部分

Yelo_Vint ( https://me.csdn.net/Yelo_Vint )

给我留言说. 我总结得不对. 如果指定了 ikey 和okey. 是可以正确识别多条通道的.

原文为:" 添加key值参数就可以了。就像vxlan的vni一样 "

第三部分.

我用两台linux 测试了两条gre通道的设置. 加上ikey和okey. 通信完全正常.

相关的设置和命令:

ip link del gre01

ip link del gre02

测试机A

ip link add gre01 type gre remote 192.168.122.16 local 192.168.122.1 ikey 1 okey 1

ip addr rep local 10.0.1.1 peer 10.0.1.2 dev gre01

ip link set gre01 up

ip link add gre02 type gre remote 192.168.122.16 local 192.168.122.1 ikey 2 okey 2

ip addr rep local 10.0.2.1 peer 10.0.2.2 dev gre02

ip link set gre02 up

测试机B

ip link add gre01 type gre remote 192.168.122.1 local 192.168.122.16 ikey 1 okey 1

ip addr rep local 10.0.1.2 peer 10.0.1.1 dev gre01

ip link set gre01 up

ip link add gre02 type gre remote 192.168.122.1 local 192.168.122.16 ikey 2 okey 2

ip addr rep local 10.0.2.2 peer 10.0.2.1 dev gre02

ip link set gre02 up

感谢:

非常感谢 Yelo_Vint 的指导. 十分感谢.