martes, 12 de noviembre de 2013

How to Delete route in Linux?

route del –net network_here netmask mask_here gw gateway_here

So in order to delete the route, the command will be executed as:

[root@pbx2 ~]# route del -net 192.168.2.55 netmask 255.255.255.0 gw 192.168.2.1

In order to delete the default route:

[root@pbx2 ~]# route del default gw 10.1.67.1

In case of a static route, the file /etc/sysconfig/network-scripts/route-eth0 also needs to be updated because after rebooting the server, the route will not be re-inserted again. So in order to avoid this, you need to delete the line that looks like below for the above route:

192.168.2.55/24 via 192.168.2.1

Please execute now the below commands to check the current routes table and it’ll be confirmed that we’ve deleted the un-wanted route via:

 [root@pbx2 ~]# route –n

OR

[root@pbx2 ~]# netstat -r

No hay comentarios:

Publicar un comentario