|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
ifstated.conf for multiple links with failoverHi,
I want to setup ifstated for multiple links. My requirement is very simple. I have 2 links. one is ADSL and the other is leased-line. When both links are up, outgoing traffic should be balanced via both links. When ADSL is DOWN, outgoing traffic should go via Leased line When Leased line is DOWN, outgoing traffic should go via ADSL line. I am wrinting /etc/ifstated.conf file. But , I still haven't achieved it. Could you pls help me to solve this. These are the urls I refer. http://gouloum.fr/doc/multilink.html http://www.suborbital.org.uk/canofworms/index.php?/archives/2-Failover-routing-with-OpenBSD-and-ifstated.html And, here's my /etc/ifstated.conf file pingVIAbothlinks = '( "ping -c 1 -I 192.168.1.253 www.google.lk >/dev/null" every 10 && "ping -c 1 -I 172.16.10.253 www.google.lk >/dev/null" every 10)' pingVIAadsl = '( "ping -c 1 -I 192.168.1.253 www.google.lk >/dev/null" every 10)' pingVIAleasedline = '( "ping -c 1 -I 172.16.10.253 www.google.lk >/dev/null" every 10)' #init-state zero state zero { init { run "route add -mpath default 192.168.1.1" run "route add -mpath default 172.16.10.254" } if ! $pingVIAadsl { set-state one } } state one { init { run "route delete -mpath default 192.168.1.1" run "route add -mpath default 172.16.10.254" } if ! $pingVIAleasedline { set-state two } } state two { init { run "route delete -mpath default 172.16.10.254" run "route add -mpath default 192.168.1.1" } if $pingVIAbothlinks { set-state zero } } Pls note: 192.168.1.253 is the ip of the PF box that connects to ADSL side. 172.16.10.253 is the leased line ip of the PF box that connects to Leased line side. here are my configuration details of the PX box ( OpenBSD - 5 - 64 bit ) # cat /etc/hostname.ne1 inet 172.16.10.253 255.255.255.0 !route add -mpath default 172.16.10.254 # cat /etc/hostname.ne2 inet 192.168.1.253 255.255.255.0 !route add -mpath default 192.168.1.1 # netstat -r |grep default default 192.168.1.1 UGSP 0 2274 - 8 ne2 default 172.16.10.254 UGSP 1 280 - 8 ne1 I have enabled below values in /etc/sysctl.conf file. net.inet.ip.forwarding=1 net.inet.ip.multipath=1 hope to hear from you. -- Thank you Indunil Jayasooriya |
|
|
Re: ifstated.conf for multiple links with failoverOn Jan 25, 2012 5:39 PM, "Indunil Jayasooriya" <indunil75@...> wrote:
> > Hi, > > > I want to setup ifstated for multiple links. > > > My requirement is very simple. > > I have 2 links. one is ADSL and the other is leased-line. > > When both links are up, outgoing traffic should be balanced via both > > When ADSL is DOWN, outgoing traffic should go via Leased line > > When Leased line is DOWN, outgoing traffic should go via ADSL line. > > I am wrinting /etc/ifstated.conf file. > > But , I still haven't achieved it. Could you pls help me to solve this. > www.openbsd.org/faq/pf/pools.html |
|
|
Re: ifstated.conf for multiple links with failover>> I am wrinting /etc/ifstated.conf file.
>> >> But , I still haven't achieved it. Could you pls help me to solve this. >> > > www.openbsd.org/faq/pf/pools.html > Hi, I have already gone to it. Does automatic fail over happens, when one link goes down? I have Not tried it. Do yo have any experience in regard to it. I am using squid as transparent proxy on my PF box. So I think I only need pass out traffic. So , I am trying the below URL. http://www.openbsd.org/faq/faq6.html#Multipath That's why I try to configure ifstated...... any comments? -- Thank you Indunil Jayasooriya |
|
|
Re: ifstated.conf for multiple links with failoverOn Thu, Jan 26, 2012 at 11:54 AM, Indunil Jayasooriya
<indunil75@...> wrote: >>> I am wrinting /etc/ifstated.conf file. >>> >>> But , I still haven't achieved it. Could you pls help me to solve this. >>> I've attached two files, my ifstated.conf and manage-routes.sh, a script I wrote for adding and removing routes based on the current state from ifstated. From your example, you cannot ping google to check if a specified WAN link is up while the gateway for that specific link is not in the routing table because it will be unreachable (Especially when both links are down, ifstated will have no way of pinging google and they will remain down.) That is why I have chosen to ping the gateways of my WAN links instead. I have been toying around with the idea of a multistage check that first pings the gateway, then google but I have not tested it yet. Hope this helps. -- Justin Jereza LPIC-2 [demime 1.01d removed an attachment of type application/octet-stream which had a name of ifstated.conf] [demime 1.01d removed an attachment of type application/x-sh which had a name of manage-routes.sh] |
|
|
Re: ifstated.conf for multiple links with failoverThanks for your reply. I am still studying your scripts.
anyway, I came across this below URL ( it is for Linux with fail over) http://tech.gaeatimes.com/index.php/archive/how-to-load-balancing-failover-with-dual-multi-wan-adsl-cable-connections-on-linux/ They are doing it. Your comments? Can I apply this to OpenBSD 5 ? |
|
|
Re: ifstated.conf for multiple links with failover> anyway, I came across this below URL ( it is for Linux with fail over)
> > http://tech.gaeatimes.com/index.php/archive/how-to-load-balancing-failover-with-dual-multi-wan-adsl-cable-connections-on-linux/ > > > They are doing it. Your comments? > > Can I apply this to OpenBSD 5 ? 1. As far as I know, only equal cost multipath routing works on OpenBSD. There is no support for weighted multipath routing. This can conceivably be simulated by using probability in pf but I have not tested it and I do not know how performance will be affected by the dropped packets. 2. A modern Linux distro should have dead gateway detection built-in so compiling a custom kernel should not be necessary. 3. That page shows RFC 1918 addresses being used in between the CPEs (Which act as NATs.) and the load balancing gateway. I would use a public IP address instead because I would rather implement the NAT in OpenBSD. This reduces the number of hops required to reach any external address by one (assuming the CPE is configured for bridging) as well as reduce the possibility of a double NAT being implemented while giving me the capability to use other OpenBSD features like altq. 4. I do not see how the alternate script provided by that page can automatically recover from a situation where both WAN links are down since a multistage ping check is not being employed either. Regards, -- Justin Jereza LPIC-2 |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |