4
Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    default         192.168.1.1     0.0.0.0         UG    202    0        0 eth0
    default         192.168.43.1    0.0.0.0         UG    303    0        0 wlan0
    192.168.1.0     *               255.255.255.0   U     202    0        0 eth0
    192.168.43.0    *               255.255.255.0   U     303    0        0 wlan0

I can remove the 192.168.1.1 entry with:

 ip route del default via 192.168.1.1

This works, but after reboot this line comes back. Any idea how to permanently have it removed with Debian-based distributions?

Andrew Volkov
  • 41
  • 1
  • 2
  • open file /etc/network/interfaces and remove route – stambata Jul 26 '16 at 08:56
  • 1
    @stambata I doubt that inside this file he'll find a `route` directive. @OP See [this](https://serverfault.com/questions/535622/how-can-i-permanently-remove-delete-a-line-in-route-with-centos-6?rq=1) as well. I guess you're using `DHCP`, right? If so, most probably your router is assigning you a default gateway as well. If that's the case, use a static configuration. – gxx Jul 26 '16 at 09:00

1 Answers1

3

It seems a DHCP server give you this GW on ETH0.

edit this file : /etc/network/interfaces

gf_ way : use a static configuration for eth0 like :

iface eth0 inet static
address 192.168.1.x
netmask 255.255.255.0

stambata way : use a post-up directive to remove this route

iface eth0 inet dhcp
post-up route del default gw 192.168.1.1
inattendu
  • 318
  • 2
  • 6