Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problem with syntax for /sbin/route?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
_Max_
Apprentice
Apprentice


Joined: 03 Mar 2003
Posts: 264
Location: London, UK

PostPosted: Mon Mar 10, 2003 5:56 pm    Post subject: problem with syntax for /sbin/route? Reply with quote

Hi,

I am having a problem with my network setup script. My net.eth0 runs the following (IPs replaced :wink: ):
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
View user's profile Send private message
weltraumfahrer
Apprentice
Apprentice


Joined: 17 Dec 2002
Posts: 195
Location: Karlsruhe, Germany

PostPosted: Mon Mar 10, 2003 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
_Max_
Apprentice
Apprentice


Joined: 03 Mar 2003
Posts: 264
Location: London, UK

PostPosted: Mon Mar 10, 2003 8:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
sigSEGV2003
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2003
Posts: 81
Location: Kansas

PostPosted: Tue Mar 11, 2003 8:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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