Re: ifconfig problem
On Mon, Jun 25, 2001 at 12:25:00PM +0100, J.A.Serralheiro wrote:
> I tried doing the configuration with ifconfig
> but I cant connect to hosts rather than the ones that lie in the same
> portion of network, I mean the ones that are attached to the same hub.
> Everything looks fine, as I said, when configured with the initilizing
> scritp /etc/inid.d/networking
> when configuring by hand with ifconfig I used:
> ifconfig eth0 address netmask mask_address up
That sets up an implicit route for the hosts on the same
ethernet segment (it is why you must specify the netmask part).
You must manually add the catch-all route, or default gateway.
/sbin/route add default gw your.gw.ip.addr
The gateway is here assumed to be on the same ethernet segment,
so you should not have to add a route to the gateway here.
I've seen some cases of networks where it was slightly different
and maybe just plain weird. For example one that wanted you to
forward traffic to another host on the same ethernet segment
via the default gateway always. The netmask on the interface
was 255.255.255.255, so there had to be an explicit route to
the gateway. Pretty odd, but not impossible.
> Also if instead of ifconfig I use ipup, thigs work fine in the same way.
Maybe there is a line "gateway 126.96.36.199" in that file?
> I read in the ifup man pages that ifup uses ifconfig.
Then they surely forgot to mention "route" in there.
> does anyone has a clue about what is this problem related with?
I hope I did and that it works for you.