Configuring Your Routing

Whereas with ifconfig and route, you use separate commands to configure the network and routing, you can use the ip command to configure both addresses and routes.

To configure routing, you need to edit the route object. You first add the default route to the Linux system:

bible:~ # ip route add default via 192.168.0.8

As you can see, this command is very similar to the way you set the default route using the route command with the exception of specifying the gw portion (which is now via).

You can view the routing information with the command ip route show: bible:~ # ip route show

192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1 127.0.0.0/8 dev lo scope link default via 192.168.0.8 dev eth0

The iproute suite of applications is now in mainstream use and its operation set is very large and well defined. Take a look at the ip man page for more information about what you can do with the ip command.

Was this article helpful?

0 0

Post a comment