On Monday 11 June 2007, dexter <[EMAIL PROTECTED]> wrote about 'Re: 
[gentoo-user] Double network cards':
> Marco Calviani pisze:
> > Hi list,
> >   i would like some technical advice concerning the possibility of
> > mounting two network devices on the same desktop computer. One network
> > card (which is binded to a fixed IP) allows me to allow the machine to
> > be visible on the public network, while the second one (faster, the
> > one i've installed now) is used to work.
>
> Hello
> If You are going to use both devices to access the same address space
> then afaik it is not possible.
> I think it could be done with static routing, but You would require
> properly configured router.

Which (surprise!) is the same thing as a properly configured linux box. :P

Basically, you simply need to make sure you configure routing for 
the "internet at large" correctly.  This will generally involve some sort 
of source-based routing and/or some custom dhclient scripts and/or 
assigning proper metrics to your routes and telling the kernel how to use 
those metrics when there are multiple routes to a single IP.

We have two networks here at the house: the cable internet (9Mbps/1Mbps, 
but those speeds can't be counted on, dynamic IP) and the DSL 
(1.5Mbps/512Kbps, I think, block of static IPs).  I've got two NICs so I'm 
on both of them.  Virtually all traffic uses the cable connection (http 
requests, bittorrent, etc.), but the DSL connection is available for 
traffic (ssh, local mail server [on the same subnet], etc.). Here's the 
relevant parts of my setup:

/etc/conf.d/net:
config_eth0=( "dhcp" )
modules_eth0=( "pump" )
pump_eth0=""
config_eth1=( "69.154.123.205/29 brd 69.154.123.207" )
modules_eth1=( "!plug" )

/etc/iproute2/rt_tables:
127     dsl

/etc/conf.d/local.start:
sbr-init

/usr/local/sbin/sbr-init:
#!/bin/bash

# Clear tables
ip route flush table dsl 2>&-

# Fill tables
ip route add 69.154.123.200/29 dev eth1 table dsl
ip route add 0.0.0.0/0 via 69.154.123.206 table dsl

# Reset rules
ip rule del pref 16000 from 69.154.123.205 2>&-

# Set rules
ip rule add pref 16000 from 69.154.123.205 table dsl

-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
[EMAIL PROTECTED]                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/     

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to