Online Promoters™ :: Web Development made simple

RTNETLINK answers: Invalid argument


While setting up the network in a linux environment you may encounter this error: RTNETLINK answers: Invalid argument
First check your /etc/sysconfig/network-scripts/ifcfg-ethX script ...
For more linux networking commands check this post.
If you use static IP addressing you might want to check out the following commands:
- check out the network adapters:
[root@linux hack]# /sbin/ifconfig
- Use Linux 'netstat' command to display or view kernel IP routing table:
[root@linux hack]# netstat -r
- The route add command below show the example to add network and host to the routing table.

[root@linux hack]# route add -net 10.1.0.0 netmask 255.255.0.0 gw 10.2.0.1 eth0
[root@linux hack]# route add -host 10.10.0.5 netmask 255.255.0.0 gw 10.2.0.1 eth0

- Adding a default route by using route command.

[root@linux hack]# route add default gw 10.10.0.1 eth0

If you use dhcp (dhcpclient) and encounter the error in discussion then you might want to check your dhcpserver configuration and also the ip class(subnet) allocation. If you have not properly configured the dhcp server so that it serves the right broadcast address and gateway you will encounter the error.
Here is an IP calculator that is very helpful ...

some info from:  http://www.labtestproject.com/linnet/routing.html