RE: How to use Route??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2003-12-30 at 23:09, Ow Mun Heng wrote:
> > -----Original Message-----
> > From: Scot L. Harris [mailto:webid@xxxxxxxxxx]
> > Sent: Wednesday, December 31, 2003 12:21 PM
> > To: shrike-list@xxxxxxxxxx
> > Subject: Re: How to use Route??
> > 
> > 
> > You only get one default gateway per system.  If you have certain
> > networks that you want to get to through specific interfaces you add
> > additional static routes for those networks.  
> >
> 
> I have 2 network cards. One is a wifi eth1 and another's LAN eth0.
> Both of these have different ip addresses and I just need them to 
> be routed differently.
> 
> eg: eth1 10.0.0.1 gw 10.0.0.10   		<-company lan
>     eth2 192.168.0.1 gw 192.168.0.10	<- wifi/internet
> 
> So.. in essence I would lke to have connections that start with 192.x to go
> through eth2 and 10.x to eth1
----
I'll cut it off right there.

if you have two interfaces # ifconfig
eth1 10.0.0.1 subnet mast 255.255.255.0
eth2 192.168.0.1 subnetmask 255.255.255.0

and you want to reach hosts on either the 192.168.0 network or the
10.0.0 network, routing is handled automatically.

You default gateway would have to be reachable by either one of those
devices as determined by the ip address and the subnet mask.

The reason to add static routes is if you want to reach networks that
are not on either of these two networks nor reachable through your
default gateway...

for example, company also has a remote office in Timbuktu which has a
network of 192.168.1.0 subnet mask 255.255.255.0  -  this network is
already tied into your existing network through a vpn/router scheme and
you want to reach the server at 192.168.1.5

Since 192.168.1.5 isn't reachable with either of your network/subnet
mask configurations, any attempts to ping/contact 192.168.1.5 will go
out to your default gateway (that's why it's a default gateway).

So to route your packets for 192.168.1.0 network through the company
router, you would need to know that ip address (i.e. 192.168.0.254) and
THEN you would have enough info to set up a static route...

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254 dev
eth2

HTH

Craig


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux