-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Describe the bug
When adding interfaces to polycube, they show down and connectivity doesn't work
To Reproduce
sudo ip netns add myapp0
sudo ip netns add myapp1
Create interfaces and up the links
sudo ip link add veth1 type veth peer name veth2
sudo ip link add veth3 type veth peer name veth4
for i in 1 2 3 4
do
sudo ip link set veth$i up
done
sudo ip link set veth2 netns myapp0
sudo ip link set veth4 netns myapp1
Add to Polycube
polycubectl br0 ports add veth1
polycubectl br0 ports add veth3
Set IP address to namespaces
sudo ip netns exec myapp0 ip addr add 10.1.1.2/24 dev veth2
sudo ip netns exec myapp1 ip addr add 10.1.1.3/24 dev veth4
Up interfaces in namespaces if required
sudo ip netns exec myapp0 sudo ip link set veth2 up
sudo ip netns exec myapp0 ip addr show
1: lo: mtu 65536 qdisc noop state DOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
14: veth2@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 2e:a9:da:40:ec:af brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.1.1.2/24 scope global veth2
valid_lft forever preferred_lft forever
inet6 fe80::2ca9:daff:fe40:ecaf/64 scope link
valid_lft forever preferred_lft forever
sudo ip netns exec myapp1 sudo ip link set veth4 up
sudo ip netns exec myapp1 ip addr show
1: lo: mtu 65536 qdisc noop state DOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
16: veth4@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 3a:49:95:d0:5a:bf brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.1.1.3/24 scope global veth4
valid_lft forever preferred_lft forever
inet6 fe80::3849:95ff:fed0:5abf/64 scope link
valid_lft forever preferred_lft forever
Verify veth1 and veth3
ip link show veth1
15: veth1@if14: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 86:83:02:57:b4:1b brd ff:ff:ff:ff:ff:ff link-netnsid 0
ip link show veth3
17: veth3@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether e2:75:0c:f1:47:1c brd ff:ff:ff:ff:ff:ff link-netnsid 1
Ping
sudo ip netns exec myapp1 ping 10.1.1.2 -c 5
PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
--- 10.1.1.2 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4100ms
Show Bridge
polycubectl br0 show
name: br0
uuid: 91081d7c-b164-4487-a161-3876467d338d
service-name: bridge
type: TC
loglevel: INFO
shadow: false
span: false
stp-enabled: false
mac: f2:f6:ae:20:3a:dc
fdb:
aging-time: 300
ports:
name uuid status peer mac mode
veth1 14720cdf-8ae2-45aa-8dad-8420e1432943 DOWN ae:8f:a6:15:f3:a3 access
veth3 ef0e0094-12aa-4fdd-96be-09326317f2d0 DOWN 36:18:34:87:f3:97 access