Static routes
U
SER
G
UIDE
147
In the same way the command:
set route host 10.1.10.10 dev null0
blocks traffic towards host
10.1.10.10
.
The
ip
command, gives the possibility to specify routes such as
:
blackhole
,
prohibit
and
unreachable
.
For example:
ip route add blackhole 1.1.1.1
ip route add prohibit 2.2.2.2
ip route add unreachable 3.3.3.3
Using
blackhole
parameter, outgoing packets will be rejected, as for
null0
route.
Using
prohibit
parameter, packets will be rejected but a Prohibit ICMP packet will be sent to the IP
source.
Using
unreachable
parameter, packets will be rejected but an Unreachable ICMP packet will be
sent to the IP source.
D
ISPLAYING STATIC ROUTES
The static routes configured can be displayed using the following command:
show ip route
For example:
root@IMOLA>
show ip route
Router# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
B - BGP, > - selected route, * - FIB route
C>* 10.10.0.0/16 is directly connected, eth0
B>* 11.11.0.0/16 [20/0] via 172.151.113.100, eth1, 09:39:06
R 11.11.0.0/16 [120/2] via 172.151.113.100, eth1, 09:39:30
C>* 11.11.11.11/32 is directly connected, ippp1
C>* 100.100.100.0/30 is directly connected, tun0
R>* 111.111.111.111/32 [120/2] via 172.151.113.100, eth1, 09:39:30
C>* 127.0.0.0/8 is directly connected, lo
C>* 172.151.0.0/16 is directly connected, eth1
C>* 202.202.202.202/32 is directly connected, dummy0
Router#
root@IMOLA>
In this way the protocol of the routes acquisition is visible.
For IPv6 routes the command is:
show ipv6 route
.
The command
show ip route
can have options, the most commonly used are:
show ip route static
show ip route bgp
show ip route ospf
show ip route rip