View Single Post
  #1   (View Single Post)  
Old 1st July 2008
ebzzry ebzzry is offline
Port Guard
 
Join Date: Jul 2008
Posts: 37
Default Problems with multiple ISP connections

My gateway has three connections with the following
information summary:

ISP #1:
Connects to: DSL modem
Interface: vr0

/etc/rc.conf.isp1
Code:
...
defaultrouter="122.53.x.x"
ifconfig_vr0="DHCP"
ifconfig_vr1="inet 203.160.x.x/24"
ifconfig_fxp0="inet 192.168.0.1/24"
...
/etc/namedb/named.conf.isp1
Code:
...
forwarders {
    59.x.x.1;
    59.x.x.2;
};
...

ISP #2:
Connects to: DSL modem
Modem IP address: 192.168.1.1;
Interface: vr1

/etc/rc.conf.isp2
Code:
...
defaultrouter="203.160.x.x"
ifconfig_vr0="DHCP"
ifconfig_vr1="DHCP"
ifconfig_fxp0="inet 192.168.0.1/24"...
/etc/namedb/named.conf.isp2
Code:
...
forwarders {
    202.138.x.50;
    202.138.x.51;
};
...

/etc/resolv.conf contains
Code:
domain some.domain
nameserver 127.0.0.1
Where "N" in "ispN" is the number that denotes the connection
from above. Whenever I want to switch connections, I run a
script that basically does the following:

Code:
route delete default

ln -sf /etc/rc.conf.ispN /etc/rc.conf
ln -sf /etc/named/named.conf.ispN /etc/named/named.conf
ln -sf /etc/ipfw.rules.ispN /etc/ipfw.rules
cp -p /etc/resolv.conf.base /etc/resolv.conf

/etc/rc.d/natd restart
/etc/rc.d/routed restart
/etc/rc.d/named restart
/etc/rc.d/routing restart
/etc/rc.d/named restart

/etc/rc.d/dhclient stop

/etc/netstart

sh /etc/ipfw.rules

cp -p /etc/resolv.conf.base /etc/resolv.conf
Using ISP1 is fine, but when I switch to ISP2, I can't
get my internet connection to work? Where have I
erred?

ISP connection #2 gives IP addresses from 192.168.1.2
and onwards.

vr1 doesn't have an IP address associated with it
as shown by the `ifconfig' output after switching to ISP2.
I tried giving it an IP address by force, via

Code:
ifconfig vr1 inet 192.168.1.2/24
but this was the message that I got:

Code:
ifconfig: ioctl (SIOCAIFADDR): File exists
I tried removing the cable connection of connection #2 and plugged it
on a standalone FreeBSD installation with one NIC, and the connection
works.

I'm really stucked and I don't have a clue how to troubleshoot this.
Reply With Quote