-
Bug
-
Resolution: Not a Bug
-
Normal
-
None
-
None
What were you trying to do that didn't work?
the support for multiple bridge for different datapaths are added in https://bugzilla.redhat.com/show_bug.cgi?id=1836209, but the nat doesn't work
[root@wsfd-advnetlab20 bz1836209]# rpm -qa | grep -E "openvswitch3.1|ovn23.03"
openvswitch3.1-3.1.0-35.el9fdp.x86_64
python3-openvswitch3.1-3.1.0-35.el9fdp.x86_64
ovn23.03-23.03.0-86.el9fdp.x86_64
ovn23.03-central-23.03.0-86.el9fdp.x86_64
ovn23.03-host-23.03.0-86.el9fdp.x86_64
Steps to reproduce
- 1. setup on server:
systemctl start openvswitch
systemctl start ovn-northd
ovn-nbctl set-connection ptcp:6641
ovn-sbctl set-connection ptcp:6642
ovn-nbctl ls-add ls1
ovn-nbctl lsp-add ls1 ls1p1
ovn-nbctl lsp-set-addresses ls1p1 "00:00:00:01:01:01 192.168.1.1 2001::1"
ovn-nbctl lsp-add ls1 ls1p2
ovn-nbctl lsp-set-addresses ls1p2 "00:00:00:01:01:02 192.168.1.2 2001::2"
ovn-nbctl lsp-add ls1 ls1p3
ovn-nbctl lsp-set-addresses ls1p3 "00:00:00:01:01:03 192.168.1.3 2001::3"
ovn-nbctl lr-add lr1
ovn-nbctl lrp-add lr1 lr1-ls1 00:00:00:00:00:01 192.168.1.254/24 2001::a/64
ovn-nbctl lsp-add ls1 ls1-lr1
ovn-nbctl lsp-set-addresses ls1-lr1 "00:00:00:00:00:01 192.168.1.254 2001::a"
ovn-nbctl lsp-set-type ls1-lr1 router
ovn-nbctl lsp-set-options ls1-lr1 router-port=lr1-ls1
ovn-nbctl lrp-add lr1 lr1-ls2 00:00:00:00:00:02 192.168.2.254/24 2002::a/64
ovn-nbctl ls-add ls2
ovn-nbctl lsp-add ls2 ls2-lr1
ovn-nbctl lsp-set-addresses ls2-lr1 "00:00:00:00:00:02 192.168.2.254 2002::a"
ovn-nbctl lsp-set-type ls2-lr1 router
ovn-nbctl lsp-set-options ls2-lr1 router-port=lr1-ls2
ovn-nbctl lsp-add ls2 ls2p1
ovn-nbctl lsp-set-addresses ls2p1 "00:00:00:01:02:01 192.168.2.1 2002::1"
ovn-nbctl lsp-add ls2 ls2p2
ovn-nbctl lsp-set-addresses ls2p2 "00:00:00:01:02:02 192.168.2.2 2002::2"
ovn-nbctl lsp-add ls2 ls2p3
ovn-nbctl lsp-set-addresses ls2p3 "00:00:00:01:02:03 192.168.2.3 2002::3"
ovs-vsctl add-br br-ext
ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet:br-ext
ovs-vsctl add-port br-ext ens1f1np1
ip_subnet=202
ovn-nbctl ls-add public
ovn-nbctl lrp-add lr1 lr1-pub 00:00:00:ff:00:01 172.16.$ip_subnet.254/24 3001:$ip_subnet::a/64 \
– lrp-set-gateway-chassis lr1-pub hv3
ovn-nbctl lsp-add public pub-lr1 – set logical_switch_port pub-lr1 type=router \
options:router-port=lr1-pub \
– lsp-set-addresses pub-lr1 router
ovn-nbctl lsp-add public pub_ln \
– lsp-set-addresses pub_ln unknown \
– lsp-set-type pub_ln localnet \
– lsp-set-options pub_ln network_name=phynet
ovn-nbctl lr-nat-add lr1 dnat_and_snat 172.16.$ip_subnet.11 192.168.1.1
ovn-nbctl lr-nat-add lr1 dnat_and_snat 172.16.$ip_subnet.13 192.168.1.3
ovs-vsctl set open . external_ids:system-id=hv3 external_ids:ovn-remote=tcp:20.0.202.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=20.0.202.25
systemctl start ovn-controller
ovs-vsctl add-port br-int ls1p3 – set interface ls1p3 type=internal external_ids:iface-id=ls1p3
ovs-vsctl add-port br-int ls2p3 – set interface ls2p3 type=internal external_ids:iface-id=ls2p3
ip netns add ls1p3
ip link set ls1p3 netns ls1p3
ip netns exec ls1p3 ip link set ls1p3 address 00:00:00:01:01:03
ip netns exec ls1p3 ip link set ls1p3 up
ip netns exec ls1p3 ip addr add 192.168.1.3/24 dev ls1p3
ip netns exec ls1p3 ip addr add 2001::3/64 dev ls1p3
ip netns exec ls1p3 ip route add default via 192.168.1.254 dev ls1p3
ip netns exec ls1p3 ip -6 route add default via 2001::a dev ls1p3
ip netns add ls2p3
ip link set ls2p3 netns ls2p3
ip netns exec ls2p3 ip link set ls2p3 address 00:00:00:01:02:03
ip netns exec ls2p3 ip link set ls2p3 up
ip netns exec ls2p3 ip addr add 192.168.2.3/24 dev ls2p3
ip netns exec ls2p3 ip addr add 2002::3/64 dev ls2p3
ip netns exec ls2p3 ip route add default via 192.168.2.254 dev ls2p3
ip netns exec ls2p3 ip -6 route add default via 2002::a dev ls2p3
- 2. setup on client
systemctl start openvswitch
ovs-vsctl add-br br-ext
ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings=phynet:br-ext
ovs-vsctl add-port br-ext ens1f1np1
ovs-vsctl set open . external_ids:ovn-set-local-ip=true
ovs-vsctl \
– set Open_vSwitch . external-ids:ovn-remote-hv1=tcp:20.0.202.25:6642 \
– set Open_vSwitch . external-ids:ovn-encap-type-hv1=geneve \
– set Open_vSwitch . external-ids:ovn-encap-ip-hv1=20.0.202.15 \
– set Open_vSwitch . external-ids:ovn-bridge-hv1=br-hv1
ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller1.log --pidfile=/run/ovn/ovn-controller.pid --detach -n hv1
sleep 3
#echo hv2 > /etc/openvswitch/system-id-override
ovs-vsctl \
– set Open_vSwitch . external-ids:ovn-remote-hv2=tcp:20.0.202.25:6642 \
– set Open_vSwitch . external-ids:ovn-encap-type-hv2=geneve \
– set Open_vSwitch . external-ids:ovn-encap-ip-hv2=20.0.202.26 \
– set Open_vSwitch . external-ids:ovn-bridge-hv2=br-hv2
ovn-controller unix:/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --user openvswitch:openvswitch --no-chdir --log-file=/var/log/ovn/ovn-controller2.log --pidfile=/run/ovn/ovn-controller2.pid --detach -n hv2
ovs-vsctl add-port br-hv1 ls1p1 – set interface ls1p1 type=internal external_ids:iface-id=ls1p1
ovs-vsctl add-port br-hv1 ls2p1 – set interface ls2p1 type=internal external_ids:iface-id=ls2p1
ip netns add ls1p1
ip link set ls1p1 netns ls1p1
ip netns exec ls1p1 ip link set ls1p1 address 00:00:00:01:01:01
ip netns exec ls1p1 ip link set ls1p1 up
ip netns exec ls1p1 ip addr add 192.168.1.1/24 dev ls1p1
ip netns exec ls1p1 ip addr add 2001::1/64 dev ls1p1
ip netns exec ls1p1 ip route add default via 192.168.1.254 dev ls1p1
ip netns exec ls1p1 ip -6 route add default via 2001::a dev ls1p1
ip netns add ls2p1
ip link set ls2p1 netns ls2p1
ip netns exec ls2p1 ip link set ls2p1 address 00:00:00:01:02:01
ip netns exec ls2p1 ip link set ls2p1 up
ip netns exec ls2p1 ip addr add 192.168.2.1/24 dev ls2p1
ip netns exec ls2p1 ip addr add 2002::1/64 dev ls2p1
ip netns exec ls2p1 ip route add default via 192.168.2.254 dev ls2p1
ip netns exec ls2p1 ip -6 route add default via 2002::a dev ls2p1
ovs-vsctl add-port br-hv2 ls1p2 – set interface ls1p2 type=internal external_ids:iface-id=ls1p2
ip netns add ls1p2
ip link set ls1p2 netns ls1p2
ip netns exec ls1p2 ip link set ls1p2 address 00:00:00:01:01:02
ip netns exec ls1p2 ip link set ls1p2 up
ip netns exec ls1p2 ip addr add 192.168.1.2/24 dev ls1p2
ip netns exec ls1p2 ip addr add 2001::2/64 dev ls1p2
ip netns exec ls1p2 ip route add default via 192.168.1.254 dev ls1p2
ip netns exec ls1p2 ip -6 route add default via 2001::a
ovs-vsctl add-port br-hv2 ls2p2 – set interface ls2p2 type=internal external_ids:iface-id=ls2p2
ip netns add ls2p2
ip link set ls2p2 netns ls2p2
ip netns exec ls2p2 ip link set ls2p2 address 00:00:00:01:02:02
ip netns exec ls2p2 ip link set ls2p2 up
ip netns exec ls2p2 ip addr add 192.168.2.2/24 dev ls2p2
ip netns exec ls2p2 ip addr add 2002::2/64 dev ls2p2
ip netns exec ls2p2 ip route add default via 192.168.2.254 dev ls2p2
ip netns exec ls2p2 ip -6 route add default via 2002::a dev ls2p2
ovs-vsctl add-port br-ext ext1 – set interface ext1 type=internal
ip netns add ext1
ip link set ext1 netns ext1
ip netns exec ext1 ip link set ext1 up
ip netns exec ext1 ip addr add 172.16.202.45/24 dev ext1
Expected results
ip netns exec ls1p1 ping 172.16.202.45 -c 1 can PASS
Actual results
ip netns exec ls1p1 ping 172.16.202.45 -c 1 FAIL
Other information
[root@wsfd-advnetlab20 bz1836209]# ovs-vsctl show
ef1922da-f012-47cd-8ea3-cd8b6f61ac44
Bridge br-hv2
fail_mode: secure
datapath_type: system
Port ovn0-hv1-0
Interface ovn0-hv1-0
type: geneve
options:
Port ls2p2
Interface ls2p2
type: internal
Port ovn0-hv3-0
Interface ovn0-hv3-0
type: geneve
options:
Port ls1p2
Interface ls1p2
type: internal
Port br-hv2
Interface br-hv2
type: internal
Bridge br-hv1
fail_mode: secure
datapath_type: system
Port ls1p1
Interface ls1p1
type: internal
Port br-hv1
Interface br-hv1
type: internal
Port ovn-hv3-0
Interface ovn-hv3-0
type: geneve
options:
Port ovn-hv2-0
Interface ovn-hv2-0
type: geneve
options:
Port ls2p1
Interface ls2p1
type: internal
Bridge br-ext
Port ens1f1np1
Interface ens1f1np1
Port br-ext
Interface br-ext
type: internal
Port ext1
Interface ext1
type: internal
ovs_version: "3.1.3"
[root@wsfd-advnetlab20 bz1836209]# ip netns exec ls1p1 ping 172.16.202.45 -c 1
PING 172.16.202.45 (172.16.202.45) 56(84) bytes of data.
— 172.16.202.45 ping statistics —
1 packets transmitted, 0 received, 100% packet loss, time 0ms
[root@wsfd-advnetlab18 bz1836209]# ovs-vsctl show
12707be9-87be-4027-8d0a-69d763e61a64
Bridge br-ext
Port patch-pub_ln-to-br-int
Interface patch-pub_ln-to-br-int
type: patch
options:
Port ens1f1np1
Interface ens1f1np1
Port br-ext
Interface br-ext
type: internal
Bridge br-int
fail_mode: secure
datapath_type: system
Port ovn-hv1-0
Interface ovn-hv1-0
type: geneve
options:
Port ovn-hv2-0
Interface ovn-hv2-0
type: geneve
options:
Port patch-br-int-to-pub_ln
Interface patch-br-int-to-pub_ln
type: patch
options:
Port br-int
Interface br-int
type: internal
Port ls2p3
Interface ls2p3
type: internal
Port ls1p3
Interface ls1p3
type: internal
ovs_version: "3.1.3"
[root@wsfd-advnetlab18 bz1836209]# ovn-sbctl show
Chassis hv2
hostname: wsfd-advnetlab20.anl.lab.eng.bos.redhat.com
Encap geneve
ip: "20.0.202.26"
options:
Port_Binding ls2p2
Port_Binding ls1p2
Chassis hv3
hostname: wsfd-advnetlab18.anl.lab.eng.bos.redhat.com
Encap geneve
ip: "20.0.202.25"
options: {csum="true"}
Port_Binding cr-lr1-pub
Port_Binding ls1p3
Port_Binding ls2p3
Chassis hv1
hostname: wsfd-advnetlab20.anl.lab.eng.bos.redhat.com
Encap geneve
ip: "20.0.202.15"
options:{csum="true"}
Port_Binding ls2p1
Port_Binding ls1p1
- links to
-
RHBA-2024:138790 ovn24.09 bug fix and enhancement update
- mentioned on