Re: multiple interfaces on same subnet?

2006-08-01 Thread Atom Powers

On 7/31/06, Joseph Gleason [EMAIL PROTECTED] wrote:

Is it possible to reach two hosts via two interfaces that are both on
the same subnet?

...

My objective is to have a FreeBSD box balance outbound traffic between
two NICs, while being able to select from among many routers that
could be the default gateway and having the two NICs connect to
different switches for fault tolerance. (I would do the fault
tolerance via a watchdog script of some sort)



Take a look at pf. pf has some very powerful nat rules that should be
able to do what you want. Use a table to specify the next-hop and use
a pfctl script for your watchdog.

--
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: multiple interfaces on same subnet?

2006-08-01 Thread Malcolm Kay
On Tue, 1 Aug 2006 05:10 am, Joseph Gleason wrote:
 Is it possible to reach two hosts via two interfaces that are
 both on the same subnet?

 Example:
 em0: 172.20.0.1/16
 em1: 172.20.0.2/16

 And I want to reach 172.20.0.3 via em0 and 172.20.0.4 via em1.

 From 'netstat -nr' I see a line like this:
 172.20/14  link#1 UC  00  
  em0

 This seems to say that anything on 172.20/14 should be reached
 on em0. Is it possible to add a rule that says that 172.20.0.4
 should be reachable on em1?


I have no personal experience of doing this, but it seems to me 
you should be able to achieve your objective by using a specific 
netmask with ifconfig rather than the CIDR / notation:
 172.20.0.1/16 - 172.20.0.1 netmask 255.255.0.1
 172.20.0.2/16 - 172.20.0.1 netmask 255.255.0.1

Then as I understand it odd numbered addresses should be reached 
via 172.20.0.1 and even numbered addresses via 172.20.0.2

 I only care about the path of outbound packets.  I don't care
 which interface inbound traffic comes on.

 I am well aware that this is a fairly strange thing to do.

 My objective is to have a FreeBSD box balance outbound traffic
 between two NICs, while being able to select from among many
 routers that could be the default gateway and having the two
 NICs connect to different switches for fault tolerance. (I
 would do the fault tolerance via a watchdog script of some
 sort)

 If it weren't for the many routers aspect, it would be
 reasonable to create separate subnets.  I need to be able to
 select from a group of around 10 possible default gateways and
 some of those routers I do not control so adding a subnet
 would be trouble.

I would expect that subnets in the routers would not be an issue 
so long as they encompass those set in ifconfig.

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


Re: multiple interfaces on same subnet?

2006-08-01 Thread Atom Powers

On 8/1/06, Malcolm Kay [EMAIL PROTECTED] wrote:


I have no personal experience of doing this, but it seems to me
you should be able to achieve your objective by using a specific
netmask with ifconfig rather than the CIDR / notation:
 172.20.0.1/16 - 172.20.0.1 netmask 255.255.0.1
 172.20.0.2/16 - 172.20.0.1 netmask 255.255.0.1



Creative idea ... even if it's breaking the rules ( so don't do it ).
Even if FreeBSD honors these subnets there is no guarantee that any
other hosts on the network will. Many systems will refuse to even
configure this kind of invalid subnet.

Plus, you can't easily scale this to the 10 networks the original
poster mentioned and it would be a nightmare to try and figure out how
to re-route traffic if one of the next-hop hosts died. (Which was also
a goal mentioned in the original post.)

Although I've head that IPFW can handle multiple dynamic redirects ( I
forswore all other firewalls as soon as I found pf ) you can do it
very simply with pf.



--
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]