# create new port on router 'tenant1' ovn-nbctl lrp-add router-tenant1 tenant1-outside 02:0a:7f:18:01:02 192.168.0.101/24 # set gateway chassis(通过ovn-sbctl show 选取central节点作为vtep网关节点) ovn-nbctl lrp-set-gateway-chassis tenant1-outside fda80787-897d-40af-811c-2c9f7caedb3b
# create new logical switch and connect it to 'router0' ovn-nbctl ls-add outside ovn-nbctl lsp-add outside outside-tenant1 ovn-nbctl lsp-set-type outside-tenant1 router ovn-nbctl lsp-set-addresses outside-tenant1 02:0a:7f:18:01:02 ovn-nbctl lsp-set-options outside-tenant1 router-port=tenant1-outside # ovn-nbctl lsp-set-options outside-tenant1 nat-addresses=router router-port=tenant1-outside
创建ovs网桥br-ex,并关联逻辑交换机outside
1 2 3 4 5
# create localnet port on 'outside'. set the network name to "phynet" ovn-nbctl lsp-add outside outside-localnet ovn-nbctl lsp-set-addresses outside-localnet unknown ovn-nbctl lsp-set-type outside-localnet localnet ovn-nbctl lsp-set-options outside-localnet network_name=phynet1
在central节点上创建ovs网桥br-ex,然后将eth1挂到ovs网桥上
1 2 3 4 5 6
# create a bridge , then mapping outside port ovs-vsctl add-br br-ex ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet1:br-ex
# add nic eth1 ovs-vsctl add-port br-ex eth1
给 central节点br-ex 配置ip测试联通
1 2
#ifconfig br-ex 192.168.0.100/24 #ip link set br-ex up