[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2 NIC
At 12:12 +0800 on 12/03/2002, Selvam wrote:
>
> I would like to setup a server with 2 NIC Cards and with different gateways,
> One will be 10.0.0.x and the other 192.168.1.x
> How can I set the default router for them so that it can work both ways?
You could set your default route for reaching the outside with an inflated
hopcount, then override it with static routes for IPs best reachable
through the other interface(s).
If you can't do whatever you need with static routes, then you'll probably
need run a routing daemon such as gated.
Below is a production example of static routes on an application proxy
gateway. Only the IPs have been translated to RFC1918 values to protect
the guilty :-).
Dramatis personae:
o xl0 is on 10.0.64.0/24 (call this the intranet side). Our
downstream router on intranet side is 10.0.64.1
o xl1 is on 192.168.1.0/24 (call this the extranet side). Our
upstream router on extranet side is 192.168.1.1
o Traffic to -most- of 10.0.0.0/8 intranet should use xl0.
o Due to upstream packet filtering idiosyncracies, however, some
few 10.0.0.0/8 subnets are on the extranet, and should use xl1.
o Rest of traffic (extranet-bound) should use xl1 as default.
Note that the default route is not set using an IP in /etc/mygate, but
rather in the hostname.xl1 file so we can also specify an inflated hopcount.
% cat /etc/mygate
cat: /etc/mygate: No such file or directory
% cat /etc/hostname.xl0
inet 10.0.64.54 255.255.255.0 NONE
!route -n add -net 10.0.0.0 10.0.64.1 -lock -hopcount 2
% cat /etc/hostname.xl1
inet 192.168.1.134 255.255.255.0 NONE
!route -n add default 192.168.1.1 -lock -hopcount 3
!route -n add -net 10.0.248.0 192.168.1.1 -lock -hopcount 1
!route -n add -net 10.0.249.0 192.168.1.1 -lock -hopcount 1
!route -n add -net 10.0.250.0 192.168.1.1 -lock -hopcount 1
!route -n add -net 10.0.251.0 192.168.1.1 -lock -hopcount 1
%
Richard
- Follow-Ups:
- Re: 2 NIC
- From: Ted U <grendel@heorot.stanford.edu>
- References:
- 2 NIC
- From: "Selvam" <selvam@bernama.com>