Saturday, May 1, 2010

Add IP and route

Commands :
[root@morgan]# ifconfig eth0 192.168.99.14 netmask 255.255.255.0 up
[root@morgan]# route add default gw 192.168.99.254 //gateway add

Adding a static route with route :
[root@morgan]# route add -net 192.168.98.0 netmask 255.255.255.0 gw 192.168.99.1

Removing a static network route and adding a static host route :
[root@morgan]# route del -net 192.168.98.0 netmask 255.255.255.0 gw 192.168.99.1
[root@morgan]# route add -net 192.168.98.42 netmask 255.255.255.255 gw 192.168.99.1 //for network
[root@morgan]# route add -host 192.168.98.42 gw 192.168.99.1

No comments:

Post a Comment