i found this useful note but can't remember where.. hope this help
|xxxxxxx][===================>
Last time I tried to add a network which is outside of my subnet and I got errors something like as follows;
# ip route add default via 100.100.100.100 dev eth0
RTNETLINK answers: Network is unreachable
# route add default gw 100.100.100.100 dev eth0
RTNETLINK answers: Network is unreachable
This error just indicates that ip “100.100.100.100″ is not reachable from my PC since the PC has got one interface with ip 10.10.10.1. Even network babies know that 100.100.100.100 is not pingable from 10.10.10.1
In very rare cases I have seen some ISPs give gateway address which does not fall in the assigned subnet, so what to do in this case?!.. interestingly windows machines do not give any errors while setting this type of gateways.
So the solution is to use “onlink” option with “ip route” command
# ip route add default via 100.100.100.100 dev eth0 onlink
When you use “onlink” option it just assume that the gateway/nexthop is directly attached to the link. Done
Windows and linux information and one stop centre for myself. Having difficulties to remember all things at once. This blog will remain be my references on the internet. Other people can take benefit from it. Thank you for visiting
Subscribe to:
Post Comments (Atom)
Simple Python Calculator This script will allows your to calculate the integers given with the chosen operation. You can add, substract, mu...
-
when trying to apt-get update i got this error message :- W: There is no public key available for the following key IDs xxxxxxxxxxxx t...
-
Skrip ini aku guna kat server aku.. backup mysql setiap hari. Hanya perlu ubah pada bahagian setting sahaja. chmod dan set cron untuk daily ...
-
This tutorial will help you get AWStats and Lighttpd working together. AWStats is an excellent log analyzer, and works well with Lighttpd. T...
2 comments:
Thanks.
I still don't understand why it wouldn't add the route in the first place, but at least it works with "onlink".
Glad it works
Post a Comment