5
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?

2
  • open file /etc/network/interfaces and remove route
    – stambata
    Jul 26, 2016 at 8:56
  • 1
    @stambata I doubt that inside this file he'll find a route directive. @OP See this 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, 2016 at 9:00

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .