(E-Mail Removed) wrote:
>Your solution worked for me. But is it a stable solution. I guess i
>wont face any problems later???
You might... if you decide to use all 253 subnets and run out
of room! ;-)
>Can u suggest an alternative, if any available.
The actual problem is merely that you need to have a route to
the gateway host before you can put in a "default" route using
that gateway. How that is done by any given distribution can
change, depending on the admin tools provided by each particular
distribution. At the base level you can read the man pages for
/ifconfig/ and /route/ to learn what they do.
The alternative to using a broader network mask, and one that
will also work if the gateway is on an entirely different IP
address segment, is to add a "host" route to that IP address
before attempting to set any route that uses it as a gateway.
For example, the 255.255.0.0 netmask works when the subnet
is 192.168.1.10 and the gateway is 192.168.100.1, but won't
work for a gateway that is 10.1.1.10. For that address,
a host network is required.
Note that a "host" route (see the man page for /route/) is merely
a network route that has a netmask which allows only a single address
to match. Hence, either of these commands will result in the exact
same route table entry:
route add -net 10.1.1.10 netmask 255.255.255.255 eth0
or
route add -host 10.1.1.10 eth0
In either case you could now do the following:
route add default gw 10.1.1.10 eth0
Which would not be valid using just the wider netmask on a
192.168.x.x subnet.
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)