The commands below should be pretty self-explanatory. Please note that the route for which i get failure is obtained by RA and has very less expiry ( e
Flag in UDAe
).
@vm:~$ ip -6 route
2001:4860:4001:800::1002 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:800::1003 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:800::1005 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:803::100e via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
fd00:ffff:ffff:fff1::/64 dev eth1 proto kernel metric 256 expires 2592300sec
fe80::/64 dev eth1 proto kernel metric 256
default via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1
default via fe80::20c:29ff:fe87:f9e7 dev eth1 proto kernel metric 1024 expires 1776sec
@vm:~$
@vm:~$
@vm:~$
@vm:~$ sudo route -6 delete default gw fe80::20c:29ff:fe87:f9e7
@vm:~$ ip -6 route
2001:4860:4001:800::1002 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:800::1003 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:800::1005 via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
2001:4860:4001:803::100e via fe80::20c:29ff:fe87:f9e7 dev eth1 proto static metric 1024
fd00:ffff:ffff:fff1::/64 dev eth1 proto kernel metric 256 expires 2592279sec
fe80::/64 dev eth1 proto kernel metric 256
default via fe80::20c:29ff:fe87:f9e7 dev eth1 proto kernel metric 1024 expires 1755sec
@vm:~$
@vm:~$
@vm:~$ sudo route -6 delete ::/0 gw fe80::20c:29ff:fe87:f9e7 dev eth1
SIOCDELRT: No such process
@vm:~$
@vm:~$
@vm:~$ route -n6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2001:4860:4001:800::1002/128 fe80::20c:29ff:fe87:f9e7 UG 1024 0 0 eth1
2001:4860:4001:800::1003/128 fe80::20c:29ff:fe87:f9e7 UG 1024 0 0 eth1
2001:4860:4001:800::1005/128 fe80::20c:29ff:fe87:f9e7 UG 1024 0 0 eth1
2001:4860:4001:803::100e/128 fe80::20c:29ff:fe87:f9e7 UG 1024 0 0 eth1
fd00:ffff:ffff:fff1::/64 :: UAe 256 0 0 eth1
fe80::/64 :: U 256 0 0 eth1
::/0 fe80::20c:29ff:fe87:f9e7 UGDAe 1024 0 0 eth1
::/0 :: !n -1 1 349 lo
::1/128 :: Un 0 1 3 lo
fd00:ffff:ffff:fff1:a00:27ff:fe7f:7245/128 :: Un 0 1 0 lo
fd00:ffff:ffff:fff1:fce8:ce07:b9ea:389f/128 :: Un 0 1 0 lo
fe80::a00:27ff:fe7f:7245/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0 eth1
::/0 :: !n -1 1 349 lo
@vm:~$
UPDATE: Another question is whats the use of link local address as the default route?
The route you are trying to delete looks like a route that was automatically added by the kernel in response to a router advertisement (RA). Be aware that if you delete it then it will probably come back on its own within 5 minutes when the router sends out another advertisement, as it will normally do periodically. If you don't want your machine to listen to router advertisements then what you probably want is to do this:
If you do that, you don't even have to bother removing it manually: it will disappear within a few minutes when it expires naturally.
Nevertheless, if you want to, you can remove it manually. It's just that it looks like the
route
command isn't able to do it. Use theip
command instead:In fact, if you are working only under Linux then I recommend that you always use the
ip
command as a modern replacement for all of the following commands:route
,ifconfig
, andnetstat
. Its syntax is much easier to handle that any of those other commands, it unifies them all together, and there are functions (likeip rule
andip tunnel
) that are only available through it.