我已经发布了类似的问题: https : //stackoverflow.com/questions/27873819/customising-docker-network-doesnt-work#
为了简化问题,让我摆脱docker工人。
这是networking模型:
| CentOS gateway --|-- enp0s9----br0----A---B 10.0.0.1 | 10.0.1.100
CentOS是一个虚拟机, enp0s9是虚拟机的网卡。 br0是一个linux桥, A是veth接口, B是A的对等体。
我使用以下命令configuration它们:
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
在这个configuration之后:
[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
但是当我从CentOS ping通网关时,使用tcpdump,我可以看到网关听到了ARP请求并回复了ARP应答。 但是enp0s9只听到ARP请求,但是听到ARP应答。
在网关上:
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
在enp0s9上:
09:54:58.748210 ARP, Request who-has 10.0.1.1 tell localhost.localdomain, length 28
我的configuration有什么问题? 如何让网关和B互相ping通?
在这个configuration中, enp0s9充当L2集线器,是否有特殊的configuration?
现在的Dockernetworking现在并不是很简单。 我会build议尝试编织 。