mercredi 14 janvier 2015

wireless automatically gets RTF_IFSCOPE default route


I have a routing problem when using a specific wireless AP from my mabcook pro.


When I connect to the AP (wireless is configured to use dhcp) I get a default route like this.



Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.20.1 UGScI 0 0 en0
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 6 8360 lo0
169.254 link#4 UCS 0 0 en0
192.168.20 link#4 UCS 1 0 en0
192.168.20.1/32 link#4 UCS 1 0 en0
192.168.20.1 6c:40:aa:ad:22:fc UHLWIir 2 24 en0 735
192.168.20.113/32 link#4 UCS 0 0 en0


Note the 'I' flag at the default route (I=RTF_IFSCOPE)


This 'I' flags prevents that the default route is used.



$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: No route to host


when I specify the interface it is used (as expected)



$ ping -b en0 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=58 time=9.374 ms


When I manually add a default route it all works (as expected)



$ sudo route add default 192.168.20.1

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=58 time=8.154 ms


In that case I have two default routes, one with 'I' one without.



Destination Gateway Flags Refs Use Netif Expire
default 192.168.20.1 UGSc 0 0 en0
default 192.168.20.1 UGScI 3 6 en0


Every time I reconnect to the AP the route is set incorrectly (with the 'I') flag.


problem: why did the automatically set default route get that 'I' flag ?


other machines using this AP have no problem. (mostly windows) When using other APs, my macbook pro connects just fine. It gets a default route without the 'I'


Question: what causes my macbook pro to set that 'I' flag ?


When not using DHCP (settings the IP/netmask/gateway) manually I also get a default route with the 'I' but only on this AP. (other APs never)





Aucun commentaire:

Enregistrer un commentaire