linux-lvs-nat模式,无法完成3次握手
ALL好!
nat模式配置好后,调度算法起作用的。但是当我通过自己的本机访问,就不能访问(只能在LB-SERVER本身上,通过wget http://vip-address/)才可以访问。
通过ipvsadm -lcn发现其TCP状态为SYN_RECV。
LB-SERVER(VIP:192.168.100.250 DIP:192.168.100.119)
RIP1:192.168.100.120 RIP:192.168.100.121。网关均指向192.168.100.119
然后通过tcpdump相关命令,发现其没有完成tcp三次握手。日志如下
在客户端(非LB-SERVER)执行,wget http://192.168.100.250/demo.html,通过tcpdump抓包结果如下
root@119-compute:/home/compute# tcpdump -n -tttt -i eth0 dst 192.168.100.250 and port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
2014-10-19 21:55:31.088510 IP 192.168.100.10.37280 > 192.168.100.250.80: Flags [S], seq 4161161539, win 29200, options [mss 1460,sackOK,TS val 80496110 ecr 0,nop,wscale 7], length 0
2014-10-19 21:55:32.085629 IP 192.168.100.10.37280 > 192.168.100.250.80: Flags [S], seq 4161161539, win 29200, options [mss 1460,sackOK,TS val 80496360 ecr 0,nop,wscale 7], length 0
root@120-compute:/usr/local/tomcat6# tcpdump -n -tttt -i eth0 dst 192.168.100.120 and port 80
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
2014-10-19 21:58:10.628408 IP 192.168.100.10.37292 > 192.168.100.120.80: Flags [S], seq 2146963872, win 29200, options [mss 1460,sackOK,TS val 80533821 ecr 0,nop,wscale 7], length 0
2014-10-19 21:58:10.628543 IP 192.168.100.10.37292 > 192.168.100.120.80: Flags [R], seq 2146963873, win 0, length 0
2014-10-19 21:58:11.625935 IP 192.168.100.10.37292 > 192.168.100.120.80: Flags [S], seq 2146963872, win 29200, options [mss 1460,sackOK,TS val 80534071 ecr 0,nop,wscale 7], length 0
2014-10-19 21:58:11.626053 IP 192.168.100.10.37292 > 192.168.100.120.80: Flags [R], seq 2146963873, win 0, length 0