How to clear (remove) routes from routing table (Cisco) To clear the complete routing table of a specific route the command clear ip route can be used.
clear ip route * / destination IP [gateway]
use * to clear complete routing table example:
router#sh ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR
Gateway of last resort is not set
C 192.168.11.0/24 is directly connected, Serial0 192.168.21.0/32 is subnetted, 1 subnets C 192.168.21.1 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Ethernet0 O E2 192.168.2.0/24 [110/20] via 192.168.11.2, 00:07:19, Serial0
To clear the complete routing table of a specific route the command clear ip route can be used.
clear ip route * / destination IP [gateway]
use * to clear complete routing table
example:
router#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is not set
C 192.168.11.0/24 is directly connected, Serial0
192.168.21.0/32 is subnetted, 1 subnets C 192.168.21.1 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Ethernet0
O E2 192.168.2.0/24 [110/20] via 192.168.11.2, 00:07:19, Serial0
router#
router#clear ip route 192.168.2.0
kaynak google.com :)