# /sbin/route add -net default gw 192.168,1.1 netmask...??

## carlos123

The Gentoo x86 installation instructions say to use the following two lines to set up a network interface manually...

```

# ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK

# /sbin/route add -net default gw $GTWAY netmask 0.0.0.0 metric 1

```

In my /etc/conf.d/net file I have the following line...

```

/sbin/ifconfig eth0 192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255..0 

```

I left out the /sbin/route line. My Gentoo seems to be working just fine in terms of connecting to the Internet.  

Is the "/sbin/route..." line really neccessary?  If so why?  When would it be neccessary?  

My internal network computers have static IP's assigned to them running through a hub to a firewall which in turn connects out to the Internet.  

Thanks for any insight on this.  

Carlos

----------

## BonezTheGoon

The route command specifies the default gateway.  Later on in the /etc/conf.d/net file there is a special section for defining the default gateway without using the route command.

Regards,

BonezTheGoon

----------

## carlos123

If all it does is specify the default gateway then it's not neccessary for running a small home or business network that does not use gateways.  

If I was setting up a computer to interface directly to the Internet itself then I can see where this line would be useful.  

Thanks BonezTheGoon.  Much appreciated.  

Carlos 

PS.  Seems like the installation instructions could be simplified and made to look a bit less like Linux gibberish if users were just told to add the gateway, if needed, to the section reserved for that inside /etc/conf.d/net.

----------

## Floog

 *BonezTheGoon wrote:*   

> The route command specifies the default gateway.  Later on in the /etc/conf.d/net file there is a special section for defining the default gateway without using the route command.
> 
> Regards,
> 
> BonezTheGoon

 

You folks have hit on exactly the same problem I'm having.  I just installed ver. 1.4_rc3.  My gentoo box is set with a manual ip address on my home lan:  192.168.1.7

The gentoo box then plugs into my dsl router which has a gateway ip address of 192.168.1.1

Every time I boot up my gentoo box, it won't connect to the net until I do the commands stated in Carlos123 original post.

I thought I had the syntax set up properly in my /etc/conf.d/net file, but maybe not.  So, for now I've plugged in the ifconfig and route add commands from the gentoo installation docs. to see if that will work.

But I was hoping you could show me what your /etc/conf.d/net looks like so that I can compare it and see where I may be making a form/syntax error that's preventing connection to the net.

Thanks for your help.

Mike

----------

## carlos123

Hi Mike (wow somebody with a real name  :Smile: ).  The only active line in my /etc/conf.d/net file is the following...

iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"

192.168.1.100 corrresponds to my Linux computer.  All other lines in the file are commented out.  I hope that helps. 

Carlos

----------

## Floog

 *carlos123 wrote:*   

> Hi Mike (wow somebody with a real name ).  The only active line in my /etc/conf.d/net file is the following...
> 
> iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"
> 
> 192.168.1.100 corrresponds to my Linux computer.  All other lines in the file are commented out.  I hope that helps. 
> ...

 

Hi Carlos, thanks for the speedy reply.

This is very interesting---  so you don't specify a default gateway...maybe it'll work.  I'll give it a try.

Mike

----------

## carlos123

I read in some Networking Linux HOWTO that a gateway is not needed if one does not use one.  A gateway is just a bridge between one computer network and another network.  Since I only have one network connected to my hardware firewall there is no need to assign an IP to an imaginary gateway.  At least for the two computers I have inside my network (the firewall is a third computer).  

If there is any gateway it is at my ISP but that's in their court and is not part of my computer network.  

I believe I set up my firewall with the gateway IP at my ISP but I can't remember if I needed one there or not.  

Carlos

----------

## BonezTheGoon

Floog your /etc/conf.d/net might be perfect, however if you forgot to run this line

```
rc-update add net.eth0 default
```

then the /etc/conf.d/net file is not even being used by your system upon booting.  Try running that command again (if you ran it during install properly you will get back an error indicating that net.eth0 has already been added to default, but at least you will know then) if it says OK then this is what you missed during install.

Regards,

BonezTheGoon

----------

## Floog

Hi Bonz:

Thank you for your help.  I'll give this a try when I get home from work today.  I think I may have missed doing this command during installation.

Mike

P.S.-- I'm amazed at the level of activity in the gentoo community.  This distro. has quite a bit going on.  It's difficult being patient with the length of time it takes to complete an installation, but once you're up there's so much power with being connected to portage, etc.  Very cool stuff. 

 *BonezTheGoon wrote:*   

> Floog your /etc/conf.d/net might be perfect, however if you forgot to run this line
> 
> ```
> rc-update add net.eth0 default
> ```
> ...

 

----------

