lvs realserver转发 源IP不是VIP的问题
vip:192.168.1.242
rip:192.168.1.24
[root@localhost ~]# ipvsadm
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
UDP 192.168.1.242:9660 wlc persistent 10
-> 192.168.1.24:9660 Route 1 0 0
[root@localhost ~]# ipvsadm -lcn
IPVS connection entries
pro expire state source virtual destination
UDP 00:00 UDP 192.168.2.103:0 192.168.1.242:9660 192.168.1.24:9660
UDP 04:50 UDP 192.168.2.103:5656 192.168.1.242:9660 192.168.1.24:9660
在rip上抓包:
16:55:15.292853 IP 192.168.2.103.5656 > 192.168.1.242.9660: UDP, length 88
0x0000: 4500 0074 0000 4000 4011 b4cf c0a8 0267 E..t..@.@......g
0x0010: c0a8 01f2 1618 25bc 0060 12ab ab00 0100 ......%..`......
0x0020: 3800 0004 dd00 0000 01fa 9d00 0000 1011 8...............
0x0030: 0022 0100 0000 6400 0003 e700 0000 0100 ."....d.........
0x0040: 0000 0200 0000 0300 0000 0400 0000 0500 ................
0x0050: 0000 0600 3943 4445 3943 3046 3234 3442 ....9CDE9C0F244B
0x0060: 3839 3730 3236 3737 3042 3243 3635 3244 897026770B2C652D
0x0070: 3438 3437 4847
16:55:15.301755 IP 192.168.1.24.9660 > 192.168.2.103.5656: UDP, length 55
0x0000: 4500 0053 0000 4000 4011 b5ca c0a8 0118 E..S..@.@.......
0x0010: c0a8 0267 25bc 1618 003f 8520 ab00 0100 ...g%....?......
0x0020: 1700 0004 dd00 0000 01fa 9d00 0000 1012 ................
0x0030: 0001 0080 4430 4336 4135 3833 3738 4237 ....D0C6A58378B7
0x0040: 4641 4130 3143 3844 3131 3638 3736 3633 FAA01C8D11687663
0x0050: 4131 32 A12
从抓包中可以看出,realserver给客户端的响应的IP是自己的一块物理网卡的 真实IP,而不是VIP,造成客户端无法正常接收处理此数据包,看了LVS DR原理里说REALSERVER响应给客户端的源IP应该是vip的
realserver 启动脚本如下:
#!/bin/bash
#description : Start Real Server
VIP=192.168.1.242
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo " Start LVS of Real Server"
/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
#/sbin/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
;;
stop)
/sbin/ifconfig lo:0 down
echo "close LVS Director server"
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
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
各网口状态:
[root@ciwong ~]# ip addr ls
1: lo: mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet 192.168.1.242/32 brd 192.168.1.242 scope global lo:0
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc noop qlen 1000
link/ether d4:ae:52:96:2c:9c brd ff:ff:ff:ff:ff:ff
3: eth1: mtu 1500 qdisc mq qlen 1000
link/ether d4:ae:52:96:2c:9e brd ff:ff:ff:ff:ff:ff
4: eth2: mtu 1500 qdisc mq qlen 1000
link/ether d4:ae:52:96:2c:a0 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.24/24 brd 192.168.1.255 scope global eth2
inet6 fe80::d6ae:52ff:fe96:2ca0/64 scope link
valid_lft forever preferred_lft forever
5: eth3: mtu 1500 qdisc mq qlen 1000
link/ether d4:ae:52:96:2c:a2 brd ff:ff:ff:ff:ff:ff
这里我想问为什么我的lvs里的realserver转发给客户端的是realip而不是vip呢(vip:192.168.1.242 rip:192.168.1.24),该如何配置?
Anonymous (没有被验证)
周三, 2013-09-18 13:06
Permalink
gyrfrtbhwm
Call me wind because I am abellutsoy blown away.
Anonymous (没有被验证)
周四, 2013-09-19 08:03
Permalink
oGwYHUAxDJQqdJ
You mean I don't have to pay for expert advice like this an?romey!
Anonymous (没有被验证)
周六, 2013-10-19 09:48
Permalink
QqIDoNnKWrLlOsZfd
I relaly needed to find this info, thank God!
Anonymous (没有被验证)
周二, 2013-11-05 12:01
Permalink
UYciLkVQxgYrgtrwx
free quotas car insurance health insurance quotes car insurance quote car insurance quotes
Anonymous (没有被验证)
周五, 2013-11-08 04:55
Permalink
vpOcptkHRAJslb
car insurance rates auto insurance quote auto insurance car insurance quote car insurance quotes no deposit casino online
Anonymous (没有被验证)
周日, 2013-11-10 08:42
Permalink
CYCAugUdzONGXHFcda
cheap car insurance viagra car insurance Ohio auto insurance quotes online auto insurance online casino
Anonymous (没有被验证)
周二, 2013-11-12 14:12
Permalink
QanOgtLtrRrM
viagra affordable car insurance auto insurance real online blackjack propecia
Anonymous (没有被验证)
周一, 2013-12-02 18:22
Permalink
AzshDopdNhWfJozynZM
car insurance quotes car insurance student health insurance cheap insurance online tadalafil no prescription cialis for daily use
Anonymous (没有被验证)
周三, 2013-12-11 06:59
Permalink
CUXyEXHiFNnmSETegk
auto insurance free quotes impotence causes male slots Auto Insurance Rates by Car car insurance killeen online poker
Anonymous (没有被验证)
周六, 2013-12-14 09:31
Permalink
OaqItJfPif
freedom auto insurance priligy Ciallis viagra online without prescription overnight i need cheap car insurance now cheapest car insurancr
Anonymous (没有被验证)
周日, 2013-12-15 12:33
Permalink
tPBmrlpPFNpMqR
cheap insurance quinn car insurance insurance auto quote ordering viagra online auto insurance rate slots
Anonymous (没有被验证)
周二, 2013-12-24 17:27
Permalink
CkJnlLJKqAx
cheap insurance car insurance for new drivers cheap insurance insureyourcaronline.com auto insurance quote online viagra kopen
Anonymous (没有被验证)
周三, 2014-03-05 17:14
Permalink
iqggewKntgHi
Thninikg like that shows an expert at work
Anonymous (没有被验证)
周三, 2014-03-05 23:05
Permalink
qSmKWyWIvjiDUHGtBhVo
Never would have thunk I would find this so innsdpeisable.
Anonymous (没有被验证)
周二, 2014-04-22 13:16
Permalink
BPXHjqCzaBVWcyNaOm
gen viagra hesowsshesews.com life insurance company rate car insurance free quotes buy cialas
Anonymous (没有被验证)
周三, 2014-05-28 02:45
Permalink
LVipGdTzuuzaOvG
cheap writers essays online to buy lowest cost in cialis cartersville insurance buy essays online
Anonymous (没有被验证)
周一, 2014-06-02 21:48
Permalink
GIAnanLQdkvalh
levitra discount presciptions car insurance rate cheapestcarinsurancerates.info vehicle insurance settlement quote on a car insureance
Anonymous (没有被验证)
周五, 2014-12-19 22:28
Permalink
BwuXZNhzuDWzRdkhpO
The ablitiy to think like that is always a joy to behold
Anonymous (没有被验证)
周三, 2014-10-22 01:28
Permalink
svgKMQsKXdQrFb
cialis online online schools generic levitra auto insurance
Anonymous (没有被验证)
周五, 2014-01-03 13:11
Permalink
fNiYXOmmzzkSJZ
cheapest car insurance in Maryland car insurance quotes free affordable health insurance policies group health insurance quotes mobile autoinsurane
Anonymous (没有被验证)
周一, 2014-01-06 23:33
Permalink
pFwmtxEkvmIbfCC
car insurance quotes health insurance companies when your job doesnt offer it CHECKING AUTO INSURANCE RATE car insurance grouping cheep car insurance auto insurance in california
Anonymous (没有被验证)
周一, 2014-01-13 18:36
Permalink
payday loans
gjdusj payday loans RHtgh payday loans bZojWI payday loans EgzRwy payday loans %-[[[ payday loans AeFwtJ payday loans 8293
Anonymous (没有被验证)
周五, 2014-01-24 21:21
Permalink
VmDxeAvtVCGpkJ
term life insurance share www.mylifeinsuranceplace.com blackjack newborn health insurance
Anonymous (没有被验证)
周二, 2014-05-06 11:18
Permalink
payday loans
gzctml payday loans 2136 unsecured loans online up to 1000 >:-[ 100 day loans pKece instant loans 5898
Anonymous (没有被验证)
周二, 2014-06-24 20:54
Permalink
quick money loans
pwouwqru quick money loans 6269 money mutual hOgcv 24 hour loans 1531 100 day loan =-]
binasa
周二, 2017-01-31 20:28
Permalink
world
It was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks. HI FROM TASHKENT
binasa
周二, 2017-01-31 20:29
Permalink
Re: Seether
KONFETO FILES