domingo, 25 de agosto de 2013

How to Delete route in Linux?

Earlier we discussed how to add a route in a Linux server according to our needs and requirements.  For network system administrators, it usually happens that after adding a route, some kind of conflict issues may occur with the current routes and so we need to delete the route that is causing issues or no longer required. We can delete a route which is very simple with the below general syntax:

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
 
 
ver tambien
 
http://linux-dominicana.blogspot.com/2013/02/configure-static-routes-in-debian-or.html 

No hay comentarios:

Publicar un comentario