1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| [root@dklwj-node02 ~]# tcpdump -i eth0 -nn host 224.0.0.1 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 22:16:20.662875 IP 172.20.7.52 > 224.0.0.1: VRRPv2, Advertisement, vrid 55, prio 99, authtype simple, intvl 1s, length 20 22:16:21.667836 IP 172.20.7.52 > 224.0.0.1: VRRPv2, Advertisement, vrid 55, prio 99, authtype simple, intvl 1s, length 20 22:16:22.669081 IP 172.20.7.52 > 224.0.0.1: VRRPv2, Advertisement, vrid 55, prio 99, authtype simple, intvl 1s, length 20 # 启动后通过ifconfig命令来查看VIP地址处于监听状态 [root@dklwj-node02 keepalived]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.20.7.52 netmask 255.255.255.0 broadcast 172.20.7.255 inet6 fe80::20c:29ff:fe6f:3ed8 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:6f:3e:d8 txqueuelen 1000 (Ethernet) RX packets 19604 bytes 24955643 (23.7 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 10657 bytes 726843 (709.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.20.7.88 netmask 255.255.255.0 broadcast 172.20.7.255 ether 00:0c:29:6f:3e:d8 txqueuelen 1000 (Ethernet)
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 1000 (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 # 不过需要注意的是新版keepalived为了安全自动在iptables上生成一条drop规则不允许内部任何协议通信需要清除掉 [root@dklwj-node02 keepalived]# iptables -vnL Chain INPUT (policy ACCEPT 153 packets, 7904 bytes) pkts bytes target prot opt in out source destination 3 180 DROP all -- * * 0.0.0.0/0 172.20.7.88
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 413 packets, 39220 bytes) pkts bytes target prot opt in out source destination [root@dklwj-node02 keepalived]# iptables -F
|