手动搭建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的连通性。


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