Skip to content

Container networking setup

Nicolas Bonnand edited this page Sep 12, 2018 · 19 revisions

11.3 Docker container networking setup

11.3.1 Interface parameters

Now we are going to create a network interface for our container ! diag

  • a Press plus to launch interface editor
  • b Enter a name for docker port that is going to be linked with container interface. Let's choose "P01".
  • c Enter a name for interface inside ALP container. Let's stay classic and choose "eth0" !
  • d Enter a vlan number for P01 port. (This is optional ). Let's choose 100.
  • e Enter a valid mac address for your container interface
  • f (optional) Enter a requested openflow port number for P01 port. Let's choose 1001
  • g Validate

11.3.2 Interface ip address config

diag

  • h Select interface config you have created in 11.3.1
  • k Press button to launch Docker net editor
  • m Select "addr"
  • n Choose a network ip / mask. ( Don't forget mask !!!)
  • o Validate

11.3.3 Default route config

diag

  • p You should see here ip net config you have configured in 11.3.2
  • q Press button to launch again Docker net editor
  • r Select "Default route"
  • s Enter 'default'
  • t Enter gateway ip
  • u Validate

11.3.4 Additional ip or routes

Note that you can repeat last steps as much as you want, if, for example, you need to define for eth0:

  • multiple ipv4 addresses
  • multiple ipv6 addresses
  • multiple static routes

11.3.5 Applying config

diag

  • w1 In the table, you should now see an interface P01,
  • w2 ip address config associated with P01
  • w3 route associated with P01
  • x Press link to apply this network template to current container ALP (x1) on bridge br0 (x2)
  • y1 (optional ) you can save this network template in order to reuse it another day.
  • y2 ( optional) you can load an already saved network template.

11.3.6 Checking networking

diag We can see that a P01 port with openflow number 1001 has been created on bridge br0.

Let's connect to container ALP. diag

  • ip addr shows a eth0 interface with mac aa:00:00:00:00:01 and address 192.168.0.1/24
  • ip route shows our default route to 192.168.0.254

Let's have a look at plotnetcfg: diag We can see that P01 is tagged with tag 100 as expected.

Clone this wiki locally