手動搭建vxlan網絡

前提:

1.  兩臺機器之間的兩個網卡能通(三層進行通信就行)


手動搭建vxlan網絡步驟

假設兩個節點分別爲:node1(10.0.0.100/24), node2 (10.0.0.101/24)

在node1執行下面的操作:

1.  ovs-vsctl add-br ovs-vxlan

2.  ovs-vsctl add-port ovs-vxlan vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=10.0.0.100 options:key=100 options:dst_port=4789

其中 key爲vxlan的vni號, dst_port爲vxlan監聽的udp端口

3.  iptables -I INPUT -p udp --dport 4789 -j ACCEPT

4.  ifconfig ovs-vxlan 192.168.0.100/24 mtu 1450 up


在node2執行類似的操作:

1.  ovs-vsctl add-br ovs-vxlan

2.  ovs-vsctl add-port ovs-vxlan vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=10.0.0.101 options:key=100 options:dst_port=4789

其中 key爲vxlan的vni號, dst_port爲vxlan監聽的udp端口

3.  iptables -I INPUT -p udp --dport 4789 -j ACCEPT

4.  ifconfig ovs-vxlan 192.168.0.101/24 mtu 1450 up


測試node1 和 node2 在vxlan橋的ip的連通性。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章