Re: [Linux-HA] urgent dhcp problem
I think Trent just supplied a great piece of this puzzle! I wasn't aware of the 'ip' command. You are right that both before and after running that script, something like 'netstat -rn' will show a default route going out eth0, and not show you anything regarding 0:0. I thought it should too, but that command seems to be more focused on the physical port. However, running 'ip route list' shows that the src parameter has changed. In the past I've started up tcpdump or wireshark to sniff the network traffic, and then start some outbound traffic, like pinging another system. I could see that before the script runs my outbound ping (echo requests) would have a source address of the regular interface, and after the script runs they would come from the floating interface. What do you see from 'ip route list'? You might also try playing with the ip route src parameter as Trent suggested. It might make for a much shorter script :-) -Ty! Trent Lloyd wrote: > you can use "ip route" with "src" parameter to effect source ip of > interface. > you could add higher metric default route, or change the default. > > Alternatively you can set $APPLICATION to bind to the floating IP, > presumign it starts after the IP is bound. > > Trent > > On 18/03/2009, at 10:40 PM, zhoupaul wrote: > >> >> Thanks boyack. But this still didn't work. After I run this script, I >> checked the routing table, the column device is still 0, I think it >> should be 0:0, is that correct? >> >>> Date: Tue, 10 Mar 2009 19:51:53 -0600 >>> From: t...@nrel.colostate.edu >>> To: linux-ha@lists.linux-ha.org >>> Subject: Re: [Linux-HA] urgent dhcp problem >>> >>> I may be wrong here, but I think what is happening is that "normal" >>> traffic is sent from a client to the floating IP (10.3.254.113), and >>> then your server knows to send back packets that are FROM that same >>> floating IP. But if your server STARTS the conversation, it sends it >>> out >>> on the native interface of 10.3.254.111. DHCP uses broadcasts to start >>> the conversation, asking the entire network for a response, and then >>> the >>> server initiates the conversation from its native interface. >>> >>> I've had this trouble in the past, and have this script: >>> >>> SNIP ## >>> #!/bin/sh >>> # >>> # Startup script to fake routing to a shared interface >>> # >>> # Use: Routing {start|stop} >>> # >>> # Licence: GPL >>> >>> # Source function library. >>> . /etc/ha.d/shellfuncs >>> >>> >>> Rstart () { >>> ha_log "info: $0: Starting" >>> sleep 5 >>> /sbin/route del default >>> /sbin/route del -net 10.3.254.0/24 eth0 >>> /sbin/route add -net 10.3.254.0/24 eth0:0 >>> /sbin/route add default gw 10.3.254.254 >>> } >>> >>> Rstop () { >>> ha_log "info: $0: Shutting down" >>> sleep 5 >>> route del default >>> route del -net 10.3.254.0/24 eth0:0 >>> route add -net 10.3.254.0/24 eth0 >>> route add default gw 10.3.254.254 >>> } >>> >>> >>> # See how we were called. >>> case "$1" in >>> start) >>> Rstart >>> ;; >>> stop) >>> Rstop >>> ;; >>> *) >>> echo "Usage: $0 {start|stop}" >>> exit 1 >>> esac >>> >>> exit 0 >>> >>> >>> SNIP ## >>> >>> This just simply tears down your normal route out eth0 and addes a new >>> route that goes out the floating address eth0:0. Doing that will remove >>> your normal default route (gateway), so it adds that back in. >>> >>> I put this script in ha.d/resource.d as a file called 'Routing' (but >>> that is probably not a very good name). >>> >>> I add this to my haresources immediately after the IP address, before I >>> start any services (yours would be 'node1-name 10.3.254.113 Routing >>> httpd sendmail dhcpd nagios') >>> >>> Note that I edited the file to use the addressed you supplied, but I >>> guessed on your netmask (assuming it was a 24 bit netmask, or >>> 255.255.255.0), and I guessed on your gateway, assuming it was >>> 10.3.254.254. You may need to change the values to match your network. >>> >>> Good luck, >>>
Re: [Linux-HA] urgent dhcp problem
you can use "ip route" with "src" parameter to effect source ip of interface. you could add higher metric default route, or change the default. Alternatively you can set $APPLICATION to bind to the floating IP, presumign it starts after the IP is bound. Trent On 18/03/2009, at 10:40 PM, zhoupaul wrote: Thanks boyack. But this still didn't work. After I run this script, I checked the routing table, the column device is still 0, I think it should be 0:0, is that correct? Date: Tue, 10 Mar 2009 19:51:53 -0600 From: t...@nrel.colostate.edu To: linux-ha@lists.linux-ha.org Subject: Re: [Linux-HA] urgent dhcp problem I may be wrong here, but I think what is happening is that "normal" traffic is sent from a client to the floating IP (10.3.254.113), and then your server knows to send back packets that are FROM that same floating IP. But if your server STARTS the conversation, it sends it out on the native interface of 10.3.254.111. DHCP uses broadcasts to start the conversation, asking the entire network for a response, and then the server initiates the conversation from its native interface. I've had this trouble in the past, and have this script: SNIP ## #!/bin/sh # # Startup script to fake routing to a shared interface # # Use: Routing {start|stop} # # Licence: GPL # Source function library. . /etc/ha.d/shellfuncs Rstart () { ha_log "info: $0: Starting" sleep 5 /sbin/route del default /sbin/route del -net 10.3.254.0/24 eth0 /sbin/route add -net 10.3.254.0/24 eth0:0 /sbin/route add default gw 10.3.254.254 } Rstop () { ha_log "info: $0: Shutting down" sleep 5 route del default route del -net 10.3.254.0/24 eth0:0 route add -net 10.3.254.0/24 eth0 route add default gw 10.3.254.254 } # See how we were called. case "$1" in start) Rstart ;; stop) Rstop ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 SNIP ## This just simply tears down your normal route out eth0 and addes a new route that goes out the floating address eth0:0. Doing that will remove your normal default route (gateway), so it adds that back in. I put this script in ha.d/resource.d as a file called 'Routing' (but that is probably not a very good name). I add this to my haresources immediately after the IP address, before I start any services (yours would be 'node1-name 10.3.254.113 Routing httpd sendmail dhcpd nagios') Note that I edited the file to use the addressed you supplied, but I guessed on your netmask (assuming it was a 24 bit netmask, or 255.255.255.0), and I guessed on your gateway, assuming it was 10.3.254.254. You may need to change the values to match your network. Good luck, -Ty! zhoupaul wrote: I have set up two nodes HA server and the haresources file like: node1-name 10.3.254.113 httpd sendmail dhcpd nagios. Two nodes have a static IP address as: 10.3.254.111 10.3.254.112. Everything seems ok except when I run ipconfig on windows client, I got dhcp server 10.3.254.111. It should be the virtual IP 10.3.254.113, what is wrong with this, how can I resolve this problem? I need to solve this problem as soon as possible, thanks for any solutions and suggestions. _ 上Windows Live 中国首页,下载最新版 MSN! http://im.live.cn/ ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems -- -===- Ty! Boyack NREL Unix Network Manager t...@nrel.colostate.edu (970) 491-1186 -===- ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems _ MSN安全保护中心,免费修复系统漏洞,保护MSN安全! http://im.live.cn/safe/ ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
RE: [Linux-HA] urgent dhcp problem
Thanks boyack. But this still didn't work. After I run this script, I checked the routing table, the column device is still 0, I think it should be 0:0, is that correct? > Date: Tue, 10 Mar 2009 19:51:53 -0600 > From: t...@nrel.colostate.edu > To: linux-ha@lists.linux-ha.org > Subject: Re: [Linux-HA] urgent dhcp problem > > I may be wrong here, but I think what is happening is that "normal" > traffic is sent from a client to the floating IP (10.3.254.113), and > then your server knows to send back packets that are FROM that same > floating IP. But if your server STARTS the conversation, it sends it out > on the native interface of 10.3.254.111. DHCP uses broadcasts to start > the conversation, asking the entire network for a response, and then the > server initiates the conversation from its native interface. > > I've had this trouble in the past, and have this script: > > SNIP ## > #!/bin/sh > # > # Startup script to fake routing to a shared interface > # > # Use: Routing {start|stop} > # > # Licence: GPL > > # Source function library. > . /etc/ha.d/shellfuncs > > > Rstart () { > ha_log "info: $0: Starting" > sleep 5 > /sbin/route del default > /sbin/route del -net 10.3.254.0/24 eth0 > /sbin/route add -net 10.3.254.0/24 eth0:0 > /sbin/route add default gw 10.3.254.254 > } > > Rstop () { > ha_log "info: $0: Shutting down" > sleep 5 > route del default > route del -net 10.3.254.0/24 eth0:0 > route add -net 10.3.254.0/24 eth0 > route add default gw 10.3.254.254 > } > > > # See how we were called. > case "$1" in > start) > Rstart > ;; > stop) > Rstop > ;; > *) > echo "Usage: $0 {start|stop}" > exit 1 > esac > > exit 0 > > > SNIP ## > > This just simply tears down your normal route out eth0 and addes a new > route that goes out the floating address eth0:0. Doing that will remove > your normal default route (gateway), so it adds that back in. > > I put this script in ha.d/resource.d as a file called 'Routing' (but > that is probably not a very good name). > > I add this to my haresources immediately after the IP address, before I > start any services (yours would be 'node1-name 10.3.254.113 Routing > httpd sendmail dhcpd nagios') > > Note that I edited the file to use the addressed you supplied, but I > guessed on your netmask (assuming it was a 24 bit netmask, or > 255.255.255.0), and I guessed on your gateway, assuming it was > 10.3.254.254. You may need to change the values to match your network. > > Good luck, > > -Ty! > > > > > zhoupaul wrote: > > I have set up two nodes HA server and the haresources file like: node1-name > > 10.3.254.113 httpd sendmail dhcpd nagios. Two nodes have a static IP > > address as: 10.3.254.111 10.3.254.112. Everything seems ok except when I > > run ipconfig on windows client, I got dhcp server 10.3.254.111. It should > > be the virtual IP 10.3.254.113, what is wrong with this, how can I resolve > > this problem? I need to solve this problem as soon as possible, thanks for > > any solutions and suggestions. > > > > _ > > 上Windows Live 中国首页,下载最新版 MSN! > > http://im.live.cn/ > > ___ > > Linux-HA mailing list > > Linux-HA@lists.linux-ha.org > > http://lists.linux-ha.org/mailman/listinfo/linux-ha > > See also: http://linux-ha.org/ReportingProblems > > > > > > > -- > -===- > Ty! Boyack > NREL Unix Network Manager > t...@nrel.colostate.edu > (970) 491-1186 > -===- > > ___ > Linux-HA mailing list > Linux-HA@lists.linux-ha.org > http://lists.linux-ha.org/mailman/listinfo/linux-ha > See also: http://linux-ha.org/ReportingProblems _ MSN安全保护中心,免费修复系统漏洞,保护MSN安全! http://im.live.cn/safe/ ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
Re: [Linux-HA] urgent dhcp problem
zhoupaul wrote: > I have set up two nodes HA server and the haresources file like: node1-name > 10.3.254.113 httpd sendmail dhcpd nagios. Two nodes have a static IP address > as: 10.3.254.111 10.3.254.112. Everything seems ok except when I run ipconfig > on windows client, I got dhcp server 10.3.254.111. It should be the virtual > IP 10.3.254.113, what is wrong with this, how can I resolve this problem? I > need to solve this problem as soon as possible, thanks for any solutions and > suggestions. > > _ > 上Windows Live 中国首页,下载最新版 MSN! > http://im.live.cn/ > ___ > Linux-HA mailing list > Linux-HA@lists.linux-ha.org > http://lists.linux-ha.org/mailman/listinfo/linux-ha > See also: http://linux-ha.org/ReportingProblems > Might try: The local-address statement *local-address* address*;* This statement causes the DHCP server to listen for DHCP requests sent to the specified address, rather than requests sent to all addresses. Since serving directly attached DHCP clients implies that the server must respond to requests sent to the all-ones IP address, this option cannot be used if clients are on directly attached net- works...it is only realistically useful for a server whose only clients are reached via unicasts, such as via DHCP relay agents. Note: This statement is only effective if the server was compiled using the USE_SOCKETS #define statement, which is default on a small number of operating systems, and must be explicitly chosen at com- pile-time for all others. You can be sure if your server is compiled with USE_SOCKETS if you see lines of this format at startup: Listening on Socket/eth0 Note also that since this bind()s all DHCP sockets to the specified address, that only one address may be supported in a daemon at a given time. ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
Re: [Linux-HA] urgent dhcp problem
I may be wrong here, but I think what is happening is that "normal" traffic is sent from a client to the floating IP (10.3.254.113), and then your server knows to send back packets that are FROM that same floating IP. But if your server STARTS the conversation, it sends it out on the native interface of 10.3.254.111. DHCP uses broadcasts to start the conversation, asking the entire network for a response, and then the server initiates the conversation from its native interface. I've had this trouble in the past, and have this script: SNIP ## #!/bin/sh # # Startup script to fake routing to a shared interface # # Use: Routing {start|stop} # # Licence: GPL # Source function library. . /etc/ha.d/shellfuncs Rstart () { ha_log "info: $0: Starting" sleep 5 /sbin/route del default /sbin/route del -net 10.3.254.0/24 eth0 /sbin/route add -net 10.3.254.0/24 eth0:0 /sbin/route add default gw 10.3.254.254 } Rstop () { ha_log "info: $0: Shutting down" sleep 5 route del default route del -net 10.3.254.0/24 eth0:0 route add -net 10.3.254.0/24 eth0 route add default gw 10.3.254.254 } # See how we were called. case "$1" in start) Rstart ;; stop) Rstop ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0 SNIP ## This just simply tears down your normal route out eth0 and addes a new route that goes out the floating address eth0:0. Doing that will remove your normal default route (gateway), so it adds that back in. I put this script in ha.d/resource.d as a file called 'Routing' (but that is probably not a very good name). I add this to my haresources immediately after the IP address, before I start any services (yours would be 'node1-name 10.3.254.113 Routing httpd sendmail dhcpd nagios') Note that I edited the file to use the addressed you supplied, but I guessed on your netmask (assuming it was a 24 bit netmask, or 255.255.255.0), and I guessed on your gateway, assuming it was 10.3.254.254. You may need to change the values to match your network. Good luck, -Ty! zhoupaul wrote: > I have set up two nodes HA server and the haresources file like: node1-name > 10.3.254.113 httpd sendmail dhcpd nagios. Two nodes have a static IP address > as: 10.3.254.111 10.3.254.112. Everything seems ok except when I run ipconfig > on windows client, I got dhcp server 10.3.254.111. It should be the virtual > IP 10.3.254.113, what is wrong with this, how can I resolve this problem? I > need to solve this problem as soon as possible, thanks for any solutions and > suggestions. > > _ > 上Windows Live 中国首页,下载最新版 MSN! > http://im.live.cn/ > ___ > Linux-HA mailing list > Linux-HA@lists.linux-ha.org > http://lists.linux-ha.org/mailman/listinfo/linux-ha > See also: http://linux-ha.org/ReportingProblems > > -- -===- Ty! Boyack NREL Unix Network Manager t...@nrel.colostate.edu (970) 491-1186 -===- ___ Linux-HA mailing list Linux-HA@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems