Posted on November 20, 2018 6:11 pm
 |  Asked by Ben Anderson
 |  64 views
Tags:
0
0
Print Friendly, PDF & Email

I turned up 2 devices, with 2 docker networks (as seen in the README). The problem with this is that you have to use docker networking and bridges. With bridges there is an additional step to allow LLDP:

echo 16384 > /sys/class/net/bridge_name/bridge/group_fwd_mask

I was hoping that I could just not use docker networking (or docker at all eventually). Here is what I did to add an interface via iproute. Is there any issue with this approach?

(ceo1 and ceos2)
localhost#show int status
Port Name Status Vlan Duplex Speed Type Flags Encapsulation
Et1 connected 1 full unconf EbraTestPhyPort
Et2 connected 1 full unconf EbraTestPhyPort
localhost#configure
localhost(config)#lldp run
localhost(config)#exit
localhost#show lldp nei
Last table change time : never
Number of table inserts : 0
Number of table deletes : 0
Number of table drops : 0
Number of table age-outs : 0

Port Neighbor Device ID Neighbor Port ID TTL

(ceos1 from bash)
bash-4.3# ifconfig
cpu: flags=4163 mtu 1500
inet6 fe80::e48e:abff:fed3:8a1b prefixlen 64 scopeid 0x20
ether e6:8e:ab:d3:8a:1b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 796 (796.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

et1: flags=4163 mtu 9214
ether 02:42:ac:c7:db:5f txqueuelen 1000 (Ethernet)
RX packets 47 bytes 6909 (6.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13 bytes 1621 (1.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

et2: flags=4163 mtu 9214
ether 02:42:ac:c7:db:5f txqueuelen 1000 (Ethernet)
RX packets 51 bytes 7257 (7.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 2020 (1.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163 mtu 1500
inet 172.17.0.3 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:acff:fe11:3 prefixlen 64 scopeid 0x20
ether 02:42:ac:11:00:03 txqueuelen 0 (Ethernet)
RX packets 5 bytes 370 (370.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 796 (796.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163 mtu 1500
inet 172.21.0.3 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:acff:fe15:3 prefixlen 64 scopeid 0x20
ether 02:42:ac:15:00:03 txqueuelen 0 (Ethernet)
RX packets 69 bytes 8818 (8.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 2628 (2.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth2: flags=4163 mtu 1500
inet 172.20.0.3 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:acff:fe14:3 prefixlen 64 scopeid 0x20
ether 02:42:ac:14:00:03 txqueuelen 0 (Ethernet)
RX packets 70 bytes 8908 (8.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 27 bytes 3069 (2.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

fabric: flags=4163 mtu 10000
inet6 fe80::42:acff:fec7:db5f prefixlen 64 scopeid 0x20
ether 02:42:ac:c7:db:5f txqueuelen 1000 (Ethernet)
RX packets 10 bytes 796 (796.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 796 (796.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

fwd0: flags=4291 mtu 1488
inet6 fe80::dc09:5bff:fed4:a51 prefixlen 64 scopeid 0x20
ether de:09:5b:d4:0a:51 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11 bytes 886 (886.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.255.255.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 498 bytes 60278 (58.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 498 bytes 60278 (58.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

No LLDP since linux bridges are set by default to drop LLDP, as previously mentioned. Bridges aren’t really needed though. Here I’ll add interfaces to the container and re-init.

(from host in python)
from pyroute2 import IPRoute
ipr = IPRoute()
ipr.link('add', kind='veth', ifname='eth3', mtu=9214, net_ns_pid=16264, peer={'ifname': 'eth3', 'mtu': 9214, 'net_ns_pid': 17000})

(on ceos 1 and ceos2)
bash-4.3# ip link set eth3 up
bash-4.3# ifconfig eth3
eth3: flags=4163 mtu 9214
inet6 fe80::3814:66ff:fec2:d72c prefixlen 64 scopeid 0x20
ether 3a:14:66:c2:d7:2c txqueuelen 1000 (Ethernet)
RX packets 10 bytes 796 (796.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 796 (796.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bash-4.3# Cli
localhost>en
localhost#show int status
Port Name Status Vlan Duplex Speed Type Flags Encapsulation
Et1 connected 1 full unconf EbraTestPhyPort
Et2 connected 1 full unconf EbraTestPhyPort
bash-4.3# init 3


(Wait some time and new exec Cli or bash. et3 interface is created)


bash-4.3# ifconfig et3
et3: flags=4163 mtu 9214
ether 02:42:ac:c7:db:5f txqueuelen 1000 (Ethernet)
RX packets 871 bytes 131115 (128.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 64 bytes 11365 (11.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bash-4.3# Cli
localhost> en
localhost#sho int status
Port Name Status Vlan Duplex Speed Type Flags Encapsulation
Et1 connected 1 full unconf EbraTestPhyPort
Et2 connected 1 full unconf EbraTestPhyPort
Et3 connected 1 full unconf EbraTestPhyPort
localhost#configure
localhost(config)#lldp run
localhost(config)#end
localhost#show lldp nei
Last table change time : 0:01:09 ago
Number of table inserts : 1
Number of table deletes : 0
Number of table drops : 0
Number of table age-outs : 0

Port Neighbor Device ID Neighbor Port ID TTL
Et3 localhost Ethernet3 120

Post your Answer

You must be logged in to post an answer.