1

I have posted a similar question at: https://stackoverflow.com/questions/27873819/customising-docker-network-doesnt-work#

To simplify the question, let me get rid of docker.

This is the network model:

          | CentOS
gateway --|-- enp0s9----br0----A---B
10.0.0.1  |                        10.0.1.100

CentOS is a VM, enp0s9 is a the VM's NIC. br0 is a linux bridge, A is a veth interface, B is A's peer.

I configure them with the following commands:

brctl addbr br0
brctl stp br0 off
brctl addif enp0s9
ip link add A type veth peer name B
brctl addif br0 A
ip link set dev A up
ip addr add 10.0.1.100/24 dev B
ip link set dev B up

After this configure:

[root@localhost ~]# ip link list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:22:dd:2e brd ff:ff:ff:ff:ff:ff
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:79:04:3a brd ff:ff:ff:ff:ff:ff
4: enp0s9: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:38:f0:e1 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT
    link/ether 08:00:27:38:f0:e1 brd ff:ff:ff:ff:ff:ff
6: B: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 8e:66:81:1c:ca:cf brd ff:ff:ff:ff:ff:ff
7: A: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP mode DEFAULT qlen 1000
    link/ether 7a:f8:de:9d:b3:33 brd ff:ff:ff:ff:ff:ff

But when I ping gateway from the CentOS, using tcpdump, I can see the gateway has heard ARP Request and replied ARP Reply. But enp0s9 hears only ARP Request but ARP Reply.

On gateway:

22:54:15.386328 ARP, Request who-has 10.0.1.1 tell 10.0.1.100, length 46
22:54:15.386350 ARP, Reply 10.0.1.1 is-at 0a:00:27:00:00:01 (oui Unknown), length 28

On enp0s9:

09:54:58.748210 ARP, Request who-has 10.0.1.1 tell localhost.localdomain, length 28

What problem is with my configure? How can make gateway and B to ping each other?

In this configure, enp0s9 acts as L2 hub, is there any special configure should be done on it?

0

Docker networking as it stands right now is not exactly simple to get right. I would recommend trying weave.

  • Disclaimer: I am part of the Weaveworks, Inc. team. – errordeveloper Jan 10 '15 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.