[LXC] bridge communiquant avec l'hôte

Applications, problèmes de configuration réseau
Avatar de l’utilisateur
ouzmoutous
Daikyu
Messages : 66
Inscription : mer. 09 nov. 2011, 19:46
Localisation : Nantes

[LXC] bridge communiquant avec l'hôte

Message par ouzmoutous »

Bonjour.

J'essaie actuellement de mettre en place un conteneur debian sur mon hôte archlinux. Je souhaiterai que mon conteneur puisse communiquer avec mon hôte.

J'ai donc installé les paquets bridge-utils et netctl pour faire des interface bridge dans "/etc/netctl/br0" :

Code : Tout sélectionner

Description="br0 connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=dhcp
Après avoir démarré l'interface avec "netctl start br0", mes interfaces sur mon hôte deviennent :

Code : Tout sélectionner

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.4.0.103  netmask 255.255.255.0  broadcast 10.4.0.255
        inet6 fe80::7cf0:cff:fe40:f4b8  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:39:4b:2b  txqueuelen 0  (Ethernet)
        RX packets 1057  bytes 104254 (101.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 129  bytes 19272 (18.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        inet6 fe80::a00:27ff:fe39:4b2b  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:39:4b:2b  txqueuelen 1000  (Ethernet)
        RX packets 1191  bytes 151036 (147.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 240  bytes 39848 (38.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Ma connection sur l'hôte passe donc sur l'interface virtuelle, donc forcement, lorsque je lance mon conteneur, il n'arrive pas à abtenir une connection. Il essaie de retrouver une adresse DHCP mais n'en obtiens pas.

Les interfaces de mon conteneur :
eth0 Link encap:Ethernet HWaddr f2:fb:65:71:17:51
inet adr:10.4.0.223 Bcast:10.4.0.255 Masque:255.255.255.0
adr inet6: fe80::f0fb:65ff:fe71:1751/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:119 errors:0 dropped:2 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:12263 (11.9 KiB) TX bytes:2700 (2.6 KiB)

lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Lorsque je lance mon conteneur, une nouvelle interface s'ajoute sur mon hôte :

Code : Tout sélectionner

vethXIM7JK: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fc30:c0ff:fe26:7174  prefixlen 64  scopeid 0x20<link>
        ether fe:30:c0:26:71:74  txqueuelen 1000  (Ethernet)
        RX packets 14  bytes 2700 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 116  bytes 11793 (11.5 KiB)
        TX errors 0  dropped 1 overruns 0  carrier 0  collisions 0

La configuration réseau de mon contenur :
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 10.4.0.223/24
Où ne me suis-je trompé ?
Répondre