Hi there,
I´ve setup a three node cluster with LXD and OVN mainly by following the video from @stgraber and the tutorial from @tomp (OVN high availability cluster tutorial).
This workded quite well so LXD as well as OVN are clustered and I’ve network connectivity across the hosts to the outside (and between containers of course).
However I need to route incoming traffic to the containers in the network as well. I’ve tried to extract and adapt the steps from lxc-ci/test-lxd-network-ovn at master · lxc/lxc-ci · GitHub. In addition I’ve read [LXD] Floating IP addresses and Difference between network forward and proxy device but I could not find out how to make it work.
Please find some configuration info below. Thank you in advance for any hint!
OVN info
# First node
# ovs-vsctl show
2a32893c-0068-4055-a75c-1156bf19ccda
Bridge lxdovn1
Port lxdovn1b
Interface lxdovn1b
Port patch-lxd-net2-ls-ext-lsp-provider-to-br-int
Interface patch-lxd-net2-ls-ext-lsp-provider-to-br-int
type: patch
options: {peer=patch-br-int-to-lxd-net2-ls-ext-lsp-provider}
Port lxdovn1
Interface lxdovn1
type: internal
Bridge br-int
fail_mode: secure
datapath_type: system
Port vethcf9752c1
Interface vethcf9752c1
Port ovn-6325bc-0
Interface ovn-6325bc-0
type: geneve
options: {csum="true", key=flow, remote_ip="xxxx:yyyy:242:4851::2"}
bfd_status: {diagnostic="No Diagnostic", flap_count="1", forwarding="true", remote_diagnostic="No Diagnostic", remote_state=up, state=up}
Port br-int
Interface br-int
type: internal
Port ovn-d07c66-0
Interface ovn-d07c66-0
type: geneve
options: {csum="true", key=flow, remote_ip="xxxx:yyyy:231:4b16::2"}
bfd_status: {diagnostic="No Diagnostic", flap_count="1", forwarding="true", remote_diagnostic="No Diagnostic", remote_state=up, state=up}
Port patch-br-int-to-lxd-net2-ls-ext-lsp-provider
Interface patch-br-int-to-lxd-net2-ls-ext-lsp-provider
type: patch
options: {peer=patch-lxd-net2-ls-ext-lsp-provider-to-br-int}
# ovn-nbctl show
switch bb62da15-ad75-4212-9024-94edd0e81ae3 (lxd-net2-ls-int)
port lxd-net2-ls-int-lsp-router
type: router
router-port: lxd-net2-lr-lrp-int
port lxd-net2-instance-c073595b-d04b-4e8c-83f3-5fa49bad4f3f-eth0
addresses: ["00:16:3e:f6:dd:6b dynamic"]
port lxd-net2-instance-3b68d1a9-b990-4dd5-9911-3dd9fef46279-eth0
addresses: ["00:16:3e:54:0b:c7 dynamic"]
port lxd-net2-instance-8206872b-e23f-4f66-8303-e5511f1347c6-eth0
addresses: ["00:16:3e:bb:18:73 dynamic"]
switch 1ff1793b-9080-477a-b33a-b66bb7bd5bb3 (lxd-net2-ls-ext)
port lxd-net2-ls-ext-lsp-router
type: router
router-port: lxd-net2-lr-lrp-ext
port lxd-net2-ls-ext-lsp-provider
type: localnet
addresses: ["unknown"]
router c48adb25-2fab-4c41-9d94-32c14b0eda38 (lxd-net2-lr)
port lxd-net2-lr-lrp-int
mac: "00:16:3e:6f:18:21"
networks: ["10.168.61.1/24", "fd42:2d80:5c48:7993::1/64"]
port lxd-net2-lr-lrp-ext
mac: "00:16:3e:6f:18:21"
networks: ["172.17.2.100/24", "fd42:a17b:8317:bd8b:216:3eff:fe6f:1821/64"]
nat 021a766f-e5f9-493a-ab96-6f59dc8f18b8
external ip: "172.17.2.100"
logical ip: "10.168.61.0/24"
type: "snat"
nat 4d9a6b2d-8793-42b5-be58-daa5e5415d51
external ip: "fd42:a17b:8317:bd8b:216:3eff:fe6f:1821"
logical ip: "fd42:2d80:5c48:7993::/64"
type: "snat"
# ovn-sbctl show
Chassis "6325bcf0-d4b6-40ba-9e78-a9de40672d4d"
hostname: srv0011.cloud.zzz.de
Encap geneve
ip: "xxx:yyyy:242:4851::2"
options: {csum="true"}
Port_Binding lxd-net2-instance-8206872b-e23f-4f66-8303-e5511f1347c6-eth0
Chassis "d07c664c-c939-4923-b5d2-3014973eec00"
hostname: srv0012.cloud.zzz.de
Encap geneve
ip: "xxx:yyyy:231:4b16::2"
options: {csum="true"}
Port_Binding cr-lxd-net2-lr-lrp-ext
Port_Binding lxd-net2-instance-3b68d1a9-b990-4dd5-9911-3dd9fef46279-eth0
Chassis "2a32893c-0068-4055-a75c-1156bf19ccda"
hostname: srv0010.cloud.zzz.de
Encap geneve
ip: "xxx:yyyy:252:1a50::2"
options: {csum="true"}
Port_Binding lxd-net2-instance-c073595b-d04b-4e8c-83f3-5fa49bad4f3f-eth0
# ovn-nbctl list load_balancer
# I've tried different scenarios after trying the failover ip did not work)
# - internal ovn ip
# - external host ip
# - external failover ip (<- this should work at the end)
_uuid : 413d97b0-9f8e-473e-b579-0f453e048abb
external_ids : {}
health_check : []
ip_port_mappings : {}
name : lxd-net2-lb-172.17.2.1-tcp
options : {}
protocol : tcp
selection_fields : []
vips : {"172.17.2.1:80"="10.168.61.3:80"}
_uuid : 17375113-421d-40c3-9355-5223ec9c995d
external_ids : {}
health_check : []
ip_port_mappings : {}
name : lxd-net2-lb-157.90.213.62-tcp
options : {}
protocol : tcp
selection_fields : []
vips : {"aaa.90.213.62:80"="10.168.61.3:80"}
_uuid : 638cb75b-e411-44d0-ae90-30f636dce284
external_ids : {}
health_check : []
ip_port_mappings : {}
name : lxd-net2-lb-144.76.20.84-tcp
options : {}
protocol : tcp
selection_fields : []
vips : {"bbb.76.20.84:80"="10.168.61.3:80"}
LXD info
# lxc list
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+-----------------------------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+-----------------------------+
| c10 | RUNNING | 10.168.61.2 (eth0) | fd42:2d80:5c48:7993:216:3eff:fef6:dd6b (eth0) | CONTAINER | 0 | srv0010.cloud.zzz.de |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+-----------------------------+
| c11 | RUNNING | 10.168.61.3 (eth0) | fd42:2d80:5c48:7993:216:3eff:febb:1873 (eth0) | CONTAINER | 0 | srv0011.cloud.zzz.de |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+-----------------------------+
| c12 | RUNNING | 10.168.61.4 (eth0) | fd42:2d80:5c48:7993:216:3eff:fe54:bc7 (eth0) | CONTAINER | 0 | srv0012.cloud.zzz.de |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+-----------------------------+
# lxc network list
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| br-int | bridge | NO | | | | 0 | |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| dmz | ovn | YES | 10.168.61.1/24 | fd42:2d80:5c48:7993::1/64 | | 3 | CREATED |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| eth0 | physical | NO | | | | 0 | |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| eth0.4000 | vlan | NO | | | | 0 | |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| lxdbr0 | bridge | YES | 172.17.2.1/24 | fd42:a17b:8317:bd8b::1/64 | | 1 | CREATED |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
| lxdovn1 | bridge | NO | | | | 0 | |
+-----------+----------+---------+----------------+---------------------------+-------------+---------+---------+
General Info
# ip a (first node)
1: lo: <LOOPBACK,UP,LOWER_UP> 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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether vv:ww:59:8c:bf:db brd ff:ff:ff:ff:ff:ff
altname enp9s0
inet aaa.90.213.62/32 scope global eth0
valid_lft forever preferred_lft forever
inet bbb.76.20.84/32 scope global eth0
valid_lft forever preferred_lft forever
inet aaa.90.213.62 peer aaa.90.213.1/32 scope global eth0
valid_lft forever preferred_lft forever
inet6 xxxx:yyyy:252:1a50::2/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::aaa1:59ff:fe8c:bfdb/64 scope link
valid_lft forever preferred_lft forever
3: eth0.4000@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group default qlen 1000
link/ether vv:ww:59:8c:bf:db brd ff:ff:ff:ff:ff:ff
inet6 fd1e:7e4b:e0b4:10:150f:db8b:f620:2/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::aaa1:59ff:fe8c:bfdb/64 scope link
valid_lft forever preferred_lft forever
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:5f:3a:69:d5:ef brd ff:ff:ff:ff:ff:ff
5: br-int: <BROADCAST,MULTICAST> mtu 1422 qdisc noop state DOWN group default qlen 1000
link/ether c6:d1:22:13:69:dc brd ff:ff:ff:ff:ff:ff
6: wgl0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1320 qdisc noqueue state UNKNOWN group default qlen 1000
link/none
inet6 fd1e:7e4b:e0b4:100:150f:db8b:f620:2/128 scope global
valid_lft forever preferred_lft forever
8: genev_sys_6081: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65000 qdisc noqueue master ovs-system state UNKNOWN group default qlen 1000
link/ether 4e:20:10:ac:d4:9a brd ff:ff:ff:ff:ff:ff
inet6 fe80::cc63:63ff:fe17:65bc/64 scope link
valid_lft forever preferred_lft forever
9: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:2d:71:a7 brd ff:ff:ff:ff:ff:ff
inet 172.17.2.1/24 scope global lxdbr0
valid_lft forever preferred_lft forever
inet6 fd42:a17b:8317:bd8b::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::216:3eff:fe2d:71a7/64 scope link
valid_lft forever preferred_lft forever
10: lxdovn1b@lxdovn1a: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master ovs-system state UP group default qlen 1000
link/ether 72:76:ca:6b:36:8c brd ff:ff:ff:ff:ff:ff
11: lxdovn1a@lxdovn1b: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP group default qlen 1000
link/ether 7a:fc:1e:9a:d6:e7 brd ff:ff:ff:ff:ff:ff
12: lxdovn1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 8e:7b:a7:5c:eb:49 brd ff:ff:ff:ff:ff:ff
14: vethcf9752c1@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1422 qdisc noqueue master ovs-system state UP group default qlen 1000
link/ether 46:d2:e5:f0:5c:e6 brd ff:ff:ff:ff:ff:ff link-netnsid 0
# ip route
default via aaa.90.213.1 dev eth0 proto static
bbb.76.20.84 dev lxdbr0 scope link
aaa.90.213.1 dev eth0 proto kernel scope link src 157.90.213.62
172.17.2.0/24 dev lxdbr0 proto kernel scope link src 172.17.2.1
172.17.2.1 dev lxdbr0 proto static scope link