View previous topic :: View next topic |
Author |
Message |
_Max_ Apprentice
Joined: 03 Mar 2003 Posts: 264 Location: London, UK
|
Posted: Mon Mar 10, 2003 5:56 pm Post subject: problem with syntax for /sbin/route? |
|
|
Hi,
I am having a problem with my network setup script. My net.eth0 runs the following (IPs replaced ):
Code: |
/sbin/ifconfig eth0 123.456.789.123 broadcast 123.456.255.255 netmask 255.255.240.0
/sbin/route add default gw 123.456.789.1 dev eth0 netmask 0.0.0.0 metric 1
|
That gives me the following output:
SIOCADDRT: Network is unreachable
ping www.google.com does not work.
If I run
Code: |
/sbin/ifconfig eth0 123.456.789.123 broadcast 123.456.255.255 netmask 255.255.240.0
/sbin/route add -net default gw 123.456.789.1 netmask 0.0.0.0 metric 1
|
no error messages, and pinging www.google.com works...
I can't figure out what the problem is supposed to be... any ideas?
Thanks,
_Max_ |
|
Back to top |
|
|
weltraumfahrer Apprentice
Joined: 17 Dec 2002 Posts: 195 Location: Karlsruhe, Germany
|
Posted: Mon Mar 10, 2003 6:16 pm Post subject: |
|
|
Hi,
route add default gw IP dev device
that's all what you need.
... and take a look at /etc/conf.d/net
Frank |
|
Back to top |
|
|
_Max_ Apprentice
Joined: 03 Mar 2003 Posts: 264 Location: London, UK
|
Posted: Mon Mar 10, 2003 8:19 pm Post subject: |
|
|
As far as I can see, /etc/conf.d/net just supplies the ip numbers and ifconfig arguments to the /etc/init.d/net.eth0 script ($IFACE and $iface_args), and then runs the commands with exactly the arguments that I describe above (tell me if I am wrong...).
Whether I run these via /etc/conf.d/net.eth0 or just type it in directly, I still get the same
SIOCADDRT: Network is unreachable
I also tried
route add default gw 123.456.789.012 dev eth0
(without the netmask and metric), but it produces the same result. Hm.... |
|
Back to top |
|
|
sigSEGV2003 Tux's lil' helper
Joined: 11 Mar 2003 Posts: 81 Location: Kansas
|
Posted: Tue Mar 11, 2003 8:04 am Post subject: |
|
|
It sounds to me like the gateway you have specified is not on your subnet. Without posting the actual IPs I can't tell. Double check your addressing and masks in /etc/conf.d/net |
|
Back to top |
|
|
|