This is from route -n
command.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.x 0.0.0.0 UG 600 0 0 <wifi>
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 <wifi>
192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 <wifi>
I have tried:
1) disabled ufw and ran from the terminal(same with ufw enabled):
sudo route del -net 169.254.0.0 gw 0.0.0.0
got SIOCDELRT: Invalid argument
2) commented link-local 169.254.0.0
line in the /etc/networks
file and rebooted.
3) disabled avahi-deamon
since it seems to be related.
Nothing works, I use static IP but always when I connect to my router and run route -n command
it appears there. So. do you guys have any other ideas?
UPDATE:
Thanks to the answer below I have looked into avahi-autoipd
manpage and managed to find a solution. To remove the route:
sudo route del -net 169.254.0.0 netmask 255.255.0.0 dev <interface> metric 1000
where <interface>
is your network interface, such as wlan0 for example. However, this would only remove it until next network association because it spawns all over again. So to make it permanent, you need to modify the /etc/network/if-up.d/avahi-autoipd
file, the root of the spawning.
I commented out the final part of the code:
#if [ -x /bin/ip ]; then
# route already present?
#ip route show | grep -q '^169.254.0.0/16[[:space:]]' && exit 0
#/bin/ip route add 169.254.0.0/16 dev $IFACE metric 1000 scope link
#elif [ -x /sbin/route ]; then
# route already present?
#/sbin/route -n | egrep -q "^169.254.0.0[[:space:]]" && exit 0
#/sbin/route add -net 169.254.0.0 netmask 255.255.0.0 dev $IFACE metric 1000
#fi