View previous topic :: View next topic |
Author |
Message |
carlos123 Guru
Joined: 12 Feb 2003 Posts: 536 Location: Alberta, Canada.
|
Posted: Thu Mar 13, 2003 2:12 am Post subject: /sbin/route add -net default gw 192.168,1.1 netmask...?? |
|
|
The Gentoo x86 installation instructions say to use the following two lines to set up a network interface manually...
Code: |
# 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...
Code: |
/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 _________________ I'm not yet a real Guru so if you are a newbie here and want to teach me a thing or two, please do! I'm still learning just like you. |
|
Back to top |
|
|
BonezTheGoon Bodhisattva
Joined: 14 Jun 2002 Posts: 1408 Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo
|
Posted: Thu Mar 13, 2003 2:25 am Post subject: |
|
|
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 |
|
Back to top |
|
|
carlos123 Guru
Joined: 12 Feb 2003 Posts: 536 Location: Alberta, Canada.
|
Posted: Thu Mar 13, 2003 3:13 am Post subject: |
|
|
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. _________________ I'm not yet a real Guru so if you are a newbie here and want to teach me a thing or two, please do! I'm still learning just like you. |
|
Back to top |
|
|
Floog Tux's lil' helper
Joined: 29 Nov 2002 Posts: 116
|
Posted: Thu Mar 13, 2003 6:16 am Post subject: |
|
|
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 |
|
Back to top |
|
|
carlos123 Guru
Joined: 12 Feb 2003 Posts: 536 Location: Alberta, Canada.
|
Posted: Thu Mar 13, 2003 6:23 am Post subject: |
|
|
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.
Carlos _________________ I'm not yet a real Guru so if you are a newbie here and want to teach me a thing or two, please do! I'm still learning just like you. |
|
Back to top |
|
|
Floog Tux's lil' helper
Joined: 29 Nov 2002 Posts: 116
|
Posted: Thu Mar 13, 2003 7:20 am Post subject: |
|
|
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.
Carlos |
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 |
|
Back to top |
|
|
carlos123 Guru
Joined: 12 Feb 2003 Posts: 536 Location: Alberta, Canada.
|
Posted: Thu Mar 13, 2003 10:15 am Post subject: |
|
|
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 _________________ I'm not yet a real Guru so if you are a newbie here and want to teach me a thing or two, please do! I'm still learning just like you. |
|
Back to top |
|
|
BonezTheGoon Bodhisattva
Joined: 14 Jun 2002 Posts: 1408 Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo
|
Posted: Thu Mar 13, 2003 3:07 pm Post subject: |
|
|
Floog your /etc/conf.d/net might be perfect, however if you forgot to run this line
Code: | 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 |
|
Back to top |
|
|
Floog Tux's lil' helper
Joined: 29 Nov 2002 Posts: 116
|
Posted: Thu Mar 13, 2003 5:16 pm Post subject: |
|
|
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
Code: | 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 |
|
|
Back to top |
|
|
|