GNU/Linux Command – IP (Part-5)

ip — Manipulate network device, routing and tunnels

Summary:
The ip is a swiss army knife command. It does many functions like assigning IP addresses to interfaces, for setting up routes and display configurations etc. Read the man page to know more about other options. In this part, we will see some of the Routing Policy DataBase (RPDB) management using IP command. RP replaces longest match rule with RPDB, which select the routes by executing some set of rules. This rules allows matching SRC, DST address, ToS, Interface field of the packet to select the routing rule.

Examples:

$ ip rule show -- List the rules. 
# ip rule add from 10.1.1.0/24 table 1 prio 600 -- Route packets
  from 10.1.1.0/24 according to table 1. 
# ip rule add iif eth1 table 2 prio 60 -- Route the packets from
  eth1 according to table 2. 
# ip rule add iif eth1 to 10.2.1.0/24 table 2 prio 66 -- Double 
  conditions. 
# ip rule del prio 600 -- Delete the rule #600. 
# ip rule del iif eth1 -- Delete the matching rule. 
# ip rule del iif eth1 to 10.2.1.0/24 -- Delete the matching rule. 
# ip rule flush -- Flush all the rules. (Don't try this). 

Read: man ip

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: