DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st July 2008
ebzzry ebzzry is offline
Port Guard
 
Join Date: Jul 2008
Posts: 37
Thanked 0 Times in 0 Posts
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
  #2   (View Single Post)  
Old 1st July 2008
J65nko J65nko is online now
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,154
Thanked 182 Times in 149 Posts
Default

I get the impression that ISP-1 asks you to use DHCP, while ISP-2 gives you a static IP address.

In the configuration of ISP-1 through vr0, which gets an address through DHCP, you assign a static IP address to vr11.
In the configuration of ISP-2 through vr1, you assign IP addresses for both vr0 and vr1 via DHCP. Where is the static address assignment for vr1?

Don't know if that is the problem

Another possibility to use ISP-1 and ISP-2 would be to use pf and balance the traffic between these two ISP's. See
http://www.openbsd.org/faq/pf/pools.html#outgoing for an example.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 1st July 2008
ebzzry ebzzry is offline
Port Guard
 
Join Date: Jul 2008
Posts: 37
Thanked 0 Times in 0 Posts
Default

The problem has already been fixed.

What happend was that I don't have a route to the second (vr1) connection.
I checked the routing table and added the appropriate route.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pf: Does pf have the ability to src-track created/established connections? gen2ly OpenBSD Security 3 27th February 2009 03:10 PM
Serial connections JMJ_coder General software and network 9 25th July 2008 03:28 PM
Multiple VPN rondynames OpenBSD General 5 24th July 2008 11:51 AM
More tcp connections tad1214 FreeBSD General 8 5th June 2008 03:05 PM
OpenVPN - Problem with connections MME General software and network 2 26th May 2008 06:42 PM


All times are GMT. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick