View previous topic :: View next topic |
Author |
Message |
SAngeli l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/132102492441d5b2db3f532.jpg)
Joined: 16 Apr 2004 Posts: 904 Location: Italy
|
Posted: Sat Apr 30, 2005 9:28 pm Post subject: [solved] route add |
|
|
Hi,
while performing a LiveCD gentoo install, I have a network setup question.
Let's take my PC as an example. I boot with LiveCD and my NIC is automatically detected.
I follow gentoo handbook for network manual setup, but I never applied this setting:
Code: | route add default gw ${GATEWAY} |
Even if I never applied this command, my PC functions well.
Can anyone please explain this command to me, its need, and if i can query what my current route settings are?
My network environment is as follows:
1) I have ADSL with one ADSL Router/modem that provides network to 3 internal PC.
Thank you,
Spiro
Last edited by SAngeli on Sun May 01, 2005 9:19 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cbx550f Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 11 Jun 2004 Posts: 113 Location: Ontario, Canada
|
Posted: Sun May 01, 2005 12:23 am Post subject: |
|
|
"default gw" points to the first router you need to find to get to the outside world.
ie: On the machine I'm on, my IP is 192.168.0.2, another machine in the building is connecting me to the internet, and it's IP is 192.168.0.1, hence I do a "route add default gw 192.168.0.1", as it is my gateway to the internet.
When you start your pc, it gets an IP and route etc from your DSL router automagically. Check it by typing "route". My output here shows:
Code: | bash-2.05b# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
loopback localhost 255.0.0.0 UG 0 0 0 lo
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
bash-2.05b# |
You can see the default route on the last line.
HTH
cbx _________________ I think, therefore I am wrong. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ZippyJay n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/159190546842741cbb789a1.jpg)
Joined: 30 Nov 2004 Posts: 73 Location: Ix
|
Posted: Sun May 01, 2005 3:32 am Post subject: |
|
|
If you don't have a gateway address assigned, your PC will still operate fine on your local network, you just (technically) won't be able to access anything outside of your network (like the Internet). Can you access the Internet right now? If you can, what stage of the install are you on? You might be retaining the default gateway from when the LiveCD grabbed info from DHCP that your router most likely is putting out. _________________ ZippyJay |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ter_roshak Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 31 Jan 2004 Posts: 171 Location: Everett, WA
|
Posted: Sun May 01, 2005 4:16 am Post subject: route add |
|
|
Explanation:
route: manipulates the kernel's routing table. You need to use the route command when you have any static routes (routes not configured through DHCP). If you assign a static IP address to your machine, you may have to use the route command so that your machine knows where to go to access the network (this is usually set through the gateway variable in the /etc/conf.d/net file).
Current settings:
You can use the netstat command to query your current route settings:
To make a long story short, you only need to add a route to the gateway if you are not using DHCP. Your DHCP dialogue will take care of it. If you are using static addressing you will have to add a gateway using route add or through your /etc/conf.d/net configuration file. _________________ Josh Miller -- RHCE, VCP
Ditree Consulting
http://ditree.com/
Registered Linux User #318200 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
SAngeli l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/132102492441d5b2db3f532.jpg)
Joined: 16 Apr 2004 Posts: 904 Location: Italy
|
Posted: Sun May 01, 2005 3:18 pm Post subject: |
|
|
Hi,
Here is my summary to understand if I got it for now.
I am connected to the Internet (ADSL) via a D-Link (ADSL Router with 4 Switch ports at 10/100Mbps).
It acts as default gateway and its address is 192.168.1.1
It also acts ad DHCP and ranges from 192.168.1.100 to 192.168.1.110
My PC IP address I decided to set it statically to 192.168.1.100
Therefore, my net configuration file is:
Code: | iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"
gateway="eth0/192.168.1.1" |
Most likely, the reason why during LiveCD install I skip the route add default gw ${GATEWAY} is because I directly write inside the /etc/conf.d/net configuration file the default gateway which is 192.168.1.1. In other words, by manually writing the default gateway inside the net file, this replaces the route add default gw ${GATEWAY} command. Correct?
Thank you,
Spiro |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
ter_roshak Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 31 Jan 2004 Posts: 171 Location: Everett, WA
|
Posted: Sun May 01, 2005 9:00 pm Post subject: route add |
|
|
You are correct, by writing to your /etc/conf.d/net file, you remove the requirement to issue the command you mention. _________________ Josh Miller -- RHCE, VCP
Ditree Consulting
http://ditree.com/
Registered Linux User #318200 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|