一、网络拓扑
主机1(192.168.100.11)---->路由主机ens34口----->绑定至OVS网桥
主机2(192.168.200.22)---->路由主机ens35口----->绑定至OVS网桥
虚接口vport1(192.168.100.254)------>绑定至OVS网桥接口vport1_br
虚接口vport2(192.168.200.254)------>绑定至OVS网桥接口vport2_br
虚接口vport1,2均在命名空间ns-router中ns-router(路由作用)
| |
client1---ens34---OVS-bridge----ens35---client2
二、配置ovs-vsctl show
55423833-9ef8-4908-8262-c293a0ab892e
Bridge "l2-lyz-br"
Port "vport1_br"
Interface "vport1_br"
Port "l2-lyz-br"
Interface "l2-lyz-br"
type: internal
Port "ens35"
Interface "ens35"
Port "ens34"
Interface "ens34"
Port "vport2_br"
Interface "vport2_br"
ovs_version: "2.11.1"ip netns exec ns-router ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
12: vport1@if11: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:d8:63:0e:8c:e2 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.100.254/24 scope global vport1
valid_lft forever preferred_lft forever
inet6 fe80::c8d8:63ff:fe0e:8ce2/64 scope link
valid_lft forever preferred_lft forever
14: vport2@if13: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:27:1e:fd:c0:c4 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.200.254/24 scope global vport2
valid_lft forever preferred_lft forever
inet6 fe80::c827:1eff:fefd:c0c4/64 scope link
valid_lft forever preferred_lft foreverlinux CentOS7 1804开启ip转发功能:echo "1" > /proc/sys/net/ipv4/ip_forward问题为:
1.在主机1上Ping192.168.200.22不通
2.在ns-router中抓包看到vport1可以收到数据包但是并未转发
3.client1可以ping通192.168.100.254和200.254求大神帮忙看下这样是否行得通或者哪里缺少配置,感激不尽!