Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread The Noob
Hello all,

I have a small question.
I have two interface in two vlans.
The first interface 192.168.0.1 255.255.255.0
The second interface: 10.228.44.1 255.255.255.0
The gateway for the first interface must be 192.168.0.254 and the second
interface must be 10.228.44.254
How can I configure them? In rc.conf we have just defaultrouter but we can't
specify the interface.
Thanks for your help
Best Regads
TheNoob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread Bill Moran
In response to The Noob [EMAIL PROTECTED]:

 Hello all,
 
 I have a small question.
 I have two interface in two vlans.
 The first interface 192.168.0.1 255.255.255.0
 The second interface: 10.228.44.1 255.255.255.0
 The gateway for the first interface must be 192.168.0.254 and the second
 interface must be 10.228.44.254
 How can I configure them? In rc.conf we have just defaultrouter but we can't
 specify the interface.

I'm curious as to why you would want to do this, since that will affect
the answer.

If those interfaces lead to different networks, then you should add
static routes as appropriate.

If they are alternate routes, then you should probably run something like
RIP to automatically update the routing table.

-- 
Bill Moran
http://www.potentialtech.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread Christopher Cowart
The Noob wrote:
 I have a small question.
 I have two interface in two vlans.
 The first interface 192.168.0.1 255.255.255.0
 The second interface: 10.228.44.1 255.255.255.0
 The gateway for the first interface must be 192.168.0.254 and the second
 interface must be 10.228.44.254
 How can I configure them? In rc.conf we have just defaultrouter but we can't
 specify the interface.

I'm guessing you want the gateway to be chosen based on the source
address, correct? The kernel does not support routing based on the
source address.

I use ipfw and fwd rules to achieve this:

ipfw add fwd 10.228.44.254 ip from 10.22.44.1 to not 10.22.44.0/24

Then you can leave the default_gateway as 192.168.0.254.

You might need IPFIREWALL_FORWARD in your kernel config. See ipfw(8).

-- 
Chris Cowart
Network Technical Lead
Network  Infrastructure Services, RSSP-IT
UC Berkeley


pgpiKYKLmOr9K.pgp
Description: PGP signature


Re: Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread Tom Marchand

You should be able to use the route command.


On Sep 10, 2008, at 1:05 PM, The Noob wrote:


Hello all,

I have a small question.
I have two interface in two vlans.
The first interface 192.168.0.1 255.255.255.0
The second interface: 10.228.44.1 255.255.255.0
The gateway for the first interface must be 192.168.0.254 and the  
second

interface must be 10.228.44.254
How can I configure them? In rc.conf we have just defaultrouter but  
we can't

specify the interface.
Thanks for your help
Best Regads
TheNoob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED] 



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread Derek Ragona

At 12:05 PM 9/10/2008, The Noob wrote:

Hello all,

I have a small question.
I have two interface in two vlans.
The first interface 192.168.0.1 255.255.255.0
The second interface: 10.228.44.1 255.255.255.0
The gateway for the first interface must be 192.168.0.254 and the second
interface must be 10.228.44.254
How can I configure them? In rc.conf we have just defaultrouter but we can't
specify the interface.
Thanks for your help
Best Regads
TheNoob


You can only have one default gateway by definition. You will need a static 
route to pass traffic from interface/subnet to the other.


-Derek

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Configure 2 gateways on a freebsd box for 2 interfaces

2008-09-10 Thread Olivier Nicole
Hi,

 The first interface 192.168.0.1 255.255.255.0
 The second interface: 10.228.44.1 255.255.255.0
 The gateway for the first interface must be 192.168.0.254 and the  
 second
 interface must be 10.228.44.254
 How can I configure them? In rc.conf we have just defaultrouter but  
 we can't
 specify the interface.

There is no way to specify an interface with the default route.

If your default route is set to 192.168.0.254, then it will use the
first interface, if the default route is set to 10.228.44.1 it will
use the second interface.

Now you need to explain why you need to default route. That is more
routing issue than FreeBSD issue.

In the routing table, you set a list of destination networks and the
interface to use to access them.

The default route is used to reach all the destinationsthat are not
listed else where in the routing table.

Your routing table will contain the default information:

- to reach network 192.168.0.0/255.255.255.0 you go through the first
  interface; no need for default route;

- to reach the network 10.228.44.0/255.255.255.0 you go through the
  second interface; no need for default route;

- to reach the locakhost you go through interface lo0; no need for
  default route;

You can use the route command to add more (many more) entries into
your routing table, and use the default route for everything else.

If your host is connected to two Internet sources (two ISPs for
example) and you want to add all the best routes for reaching ISP 1
and its clients through the first interface; and all the best routes
for reaching ISP 2 and its client through the second interface, then
you need to enable some routing protocol. And use the default route
for all everything else.

To see the routing table on your machine: netstat -r

Olivier
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: 2 Gateways.

2006-08-03 Thread Stefan Bethke


Am 02.08.2006 um 15:18 schrieb Лукьяненко Александр:


Hi, all!

Problem: PC with FreeBSD, there are 2 gateway GW1 and GW2, GW1 is
default.
Need: Queries that come from GW2 goes through GW2, not through
default.
How can I do it?


Look at ipfw forward rules, or pf rdr rules.


Stefan

--
Stefan Bethke [EMAIL PROTECTED]   Fon +49 170 346 0140


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


2 Gateways.

2006-08-02 Thread Лукьяненко Александр
Hi, all!

Problem: PC with FreeBSD, there are 2 gateway GW1 and GW2, GW1 is
default.
Need: Queries that come from GW2 goes through GW2, not through
default.
How can I do it?

-- 
mailto:[EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


2 gateways - seperate routes for different ports?

2002-09-27 Thread Alek - [EMAIL PROTECTED]

Greetings,

I currently have 2 gateway servers that I would like to consolidate.

One is a permanent dialup with a static IP - this maintains DNS, routes my
SMTP namespace and is relatively secured with IPFW.
The other is a cable connection with a dynamic IP running NAT but
unsecured because I haven’t figured out how to configure IPFW with a
dynamic IP… yet.
I want to consolidate these 2 boxes, but I would need to route port 25 and
53 traffic through the dialup connection and everything else through the
cable connection?  I expect I should be able to do this with IPFW…?  No?
Any ideas / solutions appreciated.

Cheers,

Alek.





To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: 2 gateways - seperate routes for different ports?

2002-09-27 Thread Claudiu Silaghi

On Fri, Sep 27, 2002 at 08:23:12PM +1000, Alek - [EMAIL PROTECTED] wrote:
 Greetings,
 
 I currently have 2 gateway servers that I would like to consolidate.
 
 One is a permanent dialup with a static IP - this maintains DNS, routes my
 SMTP namespace and is relatively secured with IPFW.
 The other is a cable connection with a dynamic IP running NAT but
 unsecured because I haven?t figured out how to configure IPFW with a
 dynamic IP? yet.

You could use something like this in your scripts:
/sbin/ifconfig $interface|grep broadcast|awk '{print $2}'
That should take care of the dynamic IP.

 I want to consolidate these 2 boxes, but I would need to route port 25 and
 53 traffic through the dialup connection and everything else through the
 cable connection?  I expect I should be able to do this with IPFW??  No?
 Any ideas / solutions appreciated.
 
 Cheers,
 
 Alek.
 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: 2 gateways - seperate routes for different ports?

2002-09-27 Thread D. Penev

On Fri, Sep 27, 2002 at 08:23:12PM +1000, Alek - [EMAIL PROTECTED] wrote:
Date: Fri, 27 Sep 2002 20:23:12 +1000 (EST)
Subject: 2 gateways - seperate routes for different ports?
From: Alek - [EMAIL PROTECTED] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Greetings,

I currently have 2 gateway servers that I would like to consolidate.

One is a permanent dialup with a static IP - this maintains DNS, routes my
SMTP namespace and is relatively secured with IPFW.
The other is a cable connection with a dynamic IP running NAT but
unsecured because I haven’t figured out how to configure IPFW with a
dynamic IP… yet.
I want to consolidate these 2 boxes, but I would need to route port 25 and
53 traffic through the dialup connection and everything else through the
cable connection?  I expect I should be able to do this with IPFW…?  No?
Any ideas / solutions appreciated.

Try this:

in /etc/ppp/ppp.linkup

dialup_isp_label:
 /sbin/ipfw add XXX fwd HISADDR tcp from any to any 25,53
 /sbin/ipfw add YYY fwd HISADDR udp from any to any 25,53
^^^ numbers depends of   ^^^ if you have own dns and/or mail
others ipfw rulesserver change with ip address
 that they are bind

in /etc/ppp/ppp.linkdown

dialup_isp_label:
 /sbin/ipfw delete XXX
 /sbin/ipfw delete YYY

Remove or comment add default HISADDR in dialup_isp_label section in
ppp.conf and set default route to cable connection .


Cheers,

Alek.





To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message

-- 
Regards,
D. Penev

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message