0

I am not able to delete the default gateway from my debian 11 server:-

peter@discovery:~$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.13    0.0.0.0         UG    0      0        0 enp6s0f0
0.0.0.0         0.0.0.0         0.0.0.0         U     1002   0        0 enp8s0
91.187.223.128  0.0.0.0         255.255.255.128 U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp8s0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp6s0f0
192.168.1.13    0.0.0.0         255.255.255.255 UH    0      0        0 enp6s0f0
peter@discovery:~$ sudo route del default gw 192.168.1.13
peter@discovery:~$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.13    0.0.0.0         UG    0      0        0 enp6s0f0
0.0.0.0         0.0.0.0         0.0.0.0         U     1002   0        0 enp8s0
91.187.223.128  0.0.0.0         255.255.255.128 U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp8s0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp6s0f0
192.168.1.13    0.0.0.0         255.255.255.255 UH    0      0        0 enp6s0f0

and then also:-

peter@discovery:~$ sudo ip route del default via 192.168.1.13
peter@discovery:~$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.13    0.0.0.0         UG    0      0        0 enp6s0f0
0.0.0.0         0.0.0.0         0.0.0.0         U     1002   0        0 enp8s0
91.187.223.128  0.0.0.0         255.255.255.128 U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp6s0f1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 enp8s0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 enp6s0f0
192.168.1.13    0.0.0.0         255.255.255.255 UH    0      0        0 enp6s0f0
peter@discovery:~$

The default gateway 192.168.1.13 is being very stubborn and doesn't want to go. How do I get rid of it please. I have a Debian 11 Bullseye server.

Many thanks

Just to add this is the /etc/network/interfaces file:-

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto enp6s0f0
iface enp6s0f0 inet static
  address 192.168.1.130
  netmask 255.255.255.0
  gateway 192.0.2.254

auto enp6s0f0:0
iface enp6s0f0:0 inet static
  address 192.168.1.131
  netmask 255.255.255.0

auto enp6s0f0:1
iface enp6s0f0:1 inet static
  address 192.168.1.132
  netmask 255.255.255.0

auto enp6s0f0:2
iface enp6s0f0:2 inet static
  address 192.168.1.133
  netmask 255.255.255.0

auto enp6s0f0:3
iface enp6s0f0:3 inet static
  address 192.168.1.134
  netmask 255.255.255.0

auto enp6s0f0:4
iface enp6s0f0:4 inet static
  address 192.168.1.135
  netmask 255.255.255.0

auto enp6s0f0:5
iface enp6s0f0:5 inet static
  address 192.168.1.136
  netmask 255.255.255.0

auto enp6s0f0:6
iface enp6s0f0:6 inet static
  address 192.168.1.136
  netmask 255.255.255.0

auto enp6s0f0:7
iface enp6s0f0:7 inet static
  address 192.168.1.137
  netmask 255.255.255.0

auto enp6s0f0:8
iface enp6s0f0:8 inet static
  address 192.168.1.138
  netmask 255.255.255.0

auto enp6s0f0:9
iface enp6s0f0:9 inet static
  address 192.168.1.139
  netmask 255.255.255.0

auto enp6s0f1
iface enp6s0f1 inet static
  address 91.187.223.129
  netmask 255.255.255.128

auto enp6s0f1:0
iface enp6s0f1:0 inet static
  address 91.187.223.134/25
  netmask 255.255.255.128

auto enp6s0f1:1
iface enp6s0f1:1 inet static
  address 91.187.223.210
  netmask 255.255.255.128

auto enp6s0f1:2
iface enp6s0f1:2 inet static
  address 91.187.223.211
  netmask 255.255.255.128

auto enp6s0f1:3
iface enp6s0f1:3 inet static
  address 91.187.223.212
  netmask 255.255.255.128

auto enp6s0f1:4
iface enp6s0f1:4 inet static
  address 91.187.223.213
  netmask 255.255.255.128

auto enp6s0f1:5
iface enp6s0f1:5 inet static
  address 91.187.223.214
  netmask 255.255.255.128

auto enp6s0f1:6
iface enp6s0f1:6 inet static
  address 91.187.223.215
  netmask 255.255.255.128

auto enp6s0f1:7
iface enp6s0f1:7 inet static
  address 91.187.223.216
  netmask 255.255.255.128

auto enp6s0f1:8
iface enp6s0f1:8 inet static
  address 91.187.223.217
  netmask 255.255.255.128

auto enp6s0f1:9
iface enp6s0f1:9 inet static
  address 91.187.223.218
  netmask 255.255.255.128

auto enp6s0f1:10
iface enp6s0f1:10 inet static
  address 91.187.223.219
  netmask 255.255.255.128
PistolPete
  • 21
  • 4
  • You probably have a deacon adding it back, are you using DHCP? – NiKiZe Nov 05 '21 at 08:16
  • What is this system? How is the network configured? Why it has a redundant dedicated route to `192.168.1.13/32`, which is already covered with the route to `192.168.1.0/24` (which is very unusual)? Also, you are using `ip route` for configuring routes, why don't use it always? Please, use `ip route` output instead of `route -n`. – Nikita Kipriyanov Nov 05 '21 at 08:49
  • I've only configured static ip addresses – PistolPete Nov 05 '21 at 13:52
  • Looks like Network Manager is much easier to configure the network with. Will give that a try shortly. – PistolPete Nov 05 '21 at 17:25

0 Answers0