[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: gateway



Sunil Sarat wrote:
> 
> Hi,
> 
> I have a linux machine with 2 cards installed. Both are connected to two
> different networks. I've compiled my kernel so as to enable ip forwarding.  My 2
> networks are 192.168.x.x and 202.x.x.x
> eth0 is connected to 202.x.x.x
> eth1 is connected to 192.168.x.x
> Now in the 192.168.x.x network I've configured a win9x machine with my linux
> machine as a default gateway. But still the win9x machine is unable to contact
> the server in 202.x.x.x network.
Hi Sunil,

What is the version of your linux.  Iam using Redhat Linux 5.2 (apollo)
and we have same kind of configuration. Redhat Linux directly supports
ip routing. IP Forwarding is something different. I understand that you
need only ip routing. For which you have add route. ( make default
gateway as 202.x.x.x ) And set ip-masquerading on by adding following in
the run control script /etc/rc.d/rc.fw

echo
echo "Enabling Internet Gatewaying : "
/sbin/ipfwadm -F -p deny
/sbin/ipfwadm -F -f
/sbin/ipfwadm -I -f
/sbin/ipfwadm -O -f
#
# allow any machine with address 192.168.1.x to masquerade.
#
ipfwadm -F -a accept -m -S 192.168.1.0/24 -D 0.0.0.0/0

This will allow 192.168.1.x m/c s to connect to internet thru 202.x.x.x

Your routing table should look like below
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.1.0     *               255.255.255.0   U     0      0     1303
eth1
127.0.0.0       *               255.0.0.0       U     0      0       97
lo
default         (ur ip gw)  0.0.0.0         UG    0      0    26254 eth0


Here eth0 is 202.x.x.x
and eth1 is 192.168.1.x of linux server

Believe me it works.
Good luck
Venugopal

- --------------------------------------------------------------------
To unsubscribe send an email to majordomo@xxxxxxxxx with the word
'unsubscribe linux-india' (without the quotes) in the body of the email.

------------------------------