2

I have a Raspi connected through WiFi in which I plug-in a Huawei stick I use for SMS sending. Unfortunately when doing this, it changes the routes to the following:

pi@raspberrypi:/opt/pi/printer $ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         hi.link         0.0.0.0         UG    0      0        0 eth1
default         hi.link         0.0.0.0         UG    204    0        0 eth1
default         10.0.2.1        0.0.0.0         UG    303    0        0 wlan0
10.0.2.0        *               255.255.255.0   U     303    0        0 wlan0
192.168.8.0     *               255.255.255.0   U     204    0        0 eth1

One would guess that it should be easy to remove the route, but it doesn't work:

pi@raspberrypi:/opt/pi/printer $ ping hi.link
PING hi.link (192.168.8.1) 56(84) bytes of data.
64 bytes from hi.link (192.168.8.1): icmp_seq=1 ttl=64 time=1.05 ms
pi@raspberrypi:/opt/pi/printer $ route del default via  192.168.8.0
# does NOT work, displays the usage howto

I can only get this working by adding an additional route:

pi@raspberrypi:/opt/pi/printer $ route add default gw 10.0.2.1 wlan0

Question: how do I either prevent this hi.link route being created when the Huawei stick is plugged in respective how can I delete this route

Many thanks!

2
  • 1
    Have you tried it as user root?
    – rudimeier
    Oct 13, 2016 at 7:23
  • Oh damn, my fault, sorry for that! route add default gw 10.0.2.1 wlan0 worked now nicely, but I am still not able to delete the default via 192.168.8.0 and have it in there...
    – George M.
    Oct 13, 2016 at 8:41

1 Answer 1

1

Either using the route command:

route del default gw  192.168.8.0 dev eth1

or better ip command if available:

ip route del default via 192.168.8.0 dev eth1

The ip command is easier to use because add and del usually accept the same syntax as printed by show.

1
  • I deleted as you said and it worked fine. However, from time to time, the route appears again and I keep having the same problem (I have to redo that). Any idea what could cause this?
    – silgon
    Oct 31, 2017 at 20:21

You must log in to answer this question.

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