linux vxlan实现2台机器的通往段ip互通

linux vxlan实现2台机器的通往段ip互通

- 在n1上
ip l a vxlan0 type vxlan id 42 dstport 4789 remote 192.168.1.12 local 192.168.1.11 dev eth0
ip -d l show dev vxlan0
ip a a 12.1.1.1/24 dev vxlan0 ip l s vxlan0 up ip route # 去12.1.1.0/24的数据丢给了vxlan0口 - 在n2上 ip l a vxlan0 type vxlan id 42 dstport 4789 remote 192.168.1.11 local 192.168.1.12 dev eth0 ip -d l show dev vxlan0 ip a a 12.1.1.2/24 dev vxlan0 ip l s vxlan0 up ip route
[root@n1 ~]# bridge fdb
00:00:00:00:00:00 dev vxlan0 dst 192.168.1.12 via eth0 self permanent 

https://github.com/lannyMa/scripts/blob/master/pkgs/vxlan.pcap

vxlan多播实现多台互通

- n1
ip link add vxlan0 type vxlan \
    id 42 \
    dstport 4789 \
    group 239.1.1.1 \
    dev eth0

ip addr add 12.1.1.1/24 dev vxlan0 ip link set vxlan0 up -n2 ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ group 239.1.1.1 \ dev eth0 ip addr add 12.1.1.2/24 dev vxlan0 ip link set vxlan0 up -n3 ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ group 239.1.1.1 \ dev eth0 ip addr add 12.1.1.3/24 dev vxlan0 ip link set vxlan0 up
 
 
 
转自https://www.cnblogs.com/iiiiher/p/8082779.html
 
 
 

转载于:https://www.cnblogs.com/linux-china/p/11239794.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值