mac电脑,成功启动keepalived后,其它容器可以ping通keepalived,但是宿主机ping不通。
在haproxy容器内,执行:ip add 看到如下信息:
root@a9cea49008cf:/# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
link/ipip 0.0.0.0 brd 0.0.0.0
3: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN group default qlen 1
link/tunnel6 :: brd ::
40: eth0@if41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:12:00:07 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.18.0.7/16 brd 172.18.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet 172.18.0.209/32 scope global eth0
valid_lft forever preferred_lft forever
执行ifconfig,显示如下
root@a9cea49008cf:/# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.7 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:ac:12:00:07 txqueuelen 0 (Ethernet)
RX packets 210141 bytes 46278829 (44.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 231367 bytes 16837941 (16.0 MiB)
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
loop txqueuelen 1 (Local Loopback)
RX packets 224 bytes 44382 (43.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 224 bytes 44382 (43.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0