LVS+Keepalived+BIND9的转发问题

我采用的是LVS/DR模式

这是DR服务器抓的包

[root@localhost lvs]# tcpdump udp port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 65535 bytes
16:40:39.691129 IP 222.162.25.212.51560 > 192.168.1.80.domain: 28+ A? www.8080.net. (30)
16:40:39.691146 IP 222.162.25.212.51560 > 192.168.1.80.domain: 28+ A? www.8080.net. (30)
16:40:39.694922 IP 222.162.25.212.51561 > 192.168.1.80.domain: 29+ AAAA? www.8080.net. (30)
16:40:39.694935 IP 222.162.25.212.51561 > 192.168.1.80.domain: 29+ AAAA? www.8080.net. (30)

这是realserver服务器抓的包,但是最终我没有在realserver服务器上看到发送给客户端的应答报文,不知道为什么没有应答?

[root@ns3 lvs]# tcpdump udp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:40:39.728136 IP 222.162.25.212.51560 > 192.168.1.80.domain: 28+ A? www.8080.net. (30)
16:40:39.731852 IP 222.162.25.212.51561 > 192.168.1.80.domain: 29+ AAAA? www.8080.net. (30)

这是我的realserver服务器的启动脚本

#!/bin/bash

VIP=192.168.1.80

chmod 777 /etc/rc.d/init.d/functions
. /etc/rc.d/init.d/functions

case "$1" in

start)
ifconfig lo:0 $VIP netmask 255.255.255.255 broadcast $VIP up
route add -host $VIP dev lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
sysctl -p >/dev/null 2>&1
echo "RealServer Start OK"
;;
stop)
ifconfig lo:0 down
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "0" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "0" >/proc/sys/net/ipv4/conf/all/arp_announce
sysctl -p >/dev/null 2>&1
echo "RealServer Stoped"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0

备注:我专门用这个DNS进行解析是可以正常解析的,但是我换用VIP进行解析却不能解析,不知道为什么会这样?

Forums: