host01
# podman run -d --name container1 alpine:latest /bin/sh -c "while true; do sleep 3600; done"
# podman run -d --name container2 alpine:latest /bin/sh -c "while true; do sleep 3600; done"
# podman inspect --format '{{.NetworkSettings.IPAddress}}' container1
10.88.0.5
# podman inspect --format '{{.NetworkSettings.IPAddress}}' container2
10.88.0.6
host02
# podman run -d --name container1 alpine:latest /bin/sh -c "while true; do sleep 3600; done"
# podman run -d --name container2 alpine:latest /bin/sh -c "while true; do sleep 3600; done"
# podman inspect --format '{{.NetworkSettings.IPAddress}}' container1
10.88.0.2
# podman inspect --format '{{.NetworkSettings.IPAddress}}' container2
10.88.0.3
ping
host1
# podman exec -it container1 sh
ping 10.88.0.2
host1 create ovs bridge & a veth pair
# ovs-vsctl add-br br-int
# ovs-vsctl show
537902fd-0a24-44f5-bcb9-9155fd18c7c4
Bridge br-int
Port br-int
Interface br-int
type: internal
ovs_version: "2.12.0"
# ip link add veth0 type veth peer name veth1
# ovs-vsctl add-port br-int veth1
# brctl addif cni-podman0 veth0
# ip link set veth1 up
# ip link set veth0 up
# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:25:66:c8 brd ff:ff:ff:ff:ff:ff
3: cni-podman0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether f6:7c:c9:e6:9c:a4 brd ff:ff:ff:ff:ff:ff
7: veth0faccefd@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master cni-podman0 state UP mode DEFAULT group default
link/ether 16:58:99:23:9d:ba brd ff:ff:ff:ff:ff:ff link-netns cni-25bfae2e-3338-bab3-ed63-ab93e40a26a5
8: veth72aa311e@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master cni-podman0 state UP mode DEFAULT group default
link/ether 2a:9d:b1:0c:f9:d8 brd ff:ff:ff:ff:ff:ff link-netns cni-251f4712-29e8-e5fc-6e0b-150307cd351a
9: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 16:c0:ed:6a:80:70 brd ff:ff:ff:ff:ff:ff
10: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 36:ba:2b:43:b9:49 brd ff:ff:ff:ff:ff:ff
11: veth1@veth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master ovs-system state UP mode DEFAULT group default qlen 1000
link/ether 8a:1a:4b:b3:dd:33 brd ff:ff:ff:ff:ff:ff
12: veth0@veth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master cni-podman0 state UP mode DEFAULT group default qlen 1000
link/ether aa:65:f7:84:05:03 brd ff:ff:ff:ff:ff:ff
host2 create ovs bridge & a veth pair
# ovs-vsctl add-br br-int
# ip link add veth0 type veth peer name veth1
# ovs-vsctl add-port br-int veth1
# brctl addif cni-podman0 veth0
# ip link set veth1 up
# ip link set veth0 up
GRE tunnel between host1 & host2
host1
# ovs-vsctl add-port br-int gre0 -- set interface gre0 type=gre options:remote_ip=10.0.0.2
host2
# ovs-vsctl add-port br-int gre0 -- set interface gre0 type=gre options:remote_ip=10.0.0.1
# ovs-vsctl show
537902fd-0a24-44f5-bcb9-9155fd18c7c4
Bridge br-int
Port "veth1"
Interface "veth1"
Port br-int
Interface br-int
type: internal
Port "gre0"
Interface "gre0"
type: gre
options: {remote_ip="10.0.0.2"}
ovs_version: "2.12.0"
# brctl show
bridge name bridge id STP enabled interfaces
cni-podman0 8000.f67cc9e69ca4 no veth0
veth0faccefd
veth72aa311e
test
host1
# podman exec -it container1 sh
ping 10.88.0.2