question about routing

From: richard fell (fell01_at_rcn.com)
Date: 07/31/03


Date: Thu, 31 Jul 2003 09:21:04 -0400

I have a desktop with two ethernet cards and a laptop with one ethernet
card. Both systems are running redhat 7.3 eth0 on the desktop is
connected to my cable modem. eth1 on the desktop is connected via an
ethernet cable to eth0 on the laptop to form a LAN. I have assigned
private addresses 192.168.1.1 to the desktop and 192.168.1.2 to the laptop.

I can connect to the outside world from the laptop, using the desktop as
my gateway. The output of the netstat -rn command on the laptop is the
following:
destination gateway genmask flags MSS Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 40 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 40 eth0

Here is my question. I have to temporarily connect the laptop to the
internet. So, I connect my cable modem directly to my ethernet card on
the laptop. However, to the routing table on the laptop and I am not
quite sure what to do.
Is the command
route add default gw eth0 correct? And then when it comes time to
restablish my LAN,
would I then issue the command
route add default gw 192.168.1.1

Thanks for any help,
*** Fell


Quantcast