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
 
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM