network – macOS routing table. Default gateway rule not working

SubhamSeptember 5, 2022
Spread the love

In macOS, I’ve got the following routing table for inet, as can be seen from netstat -nr

Destination        Gateway            Flags           Netif Expire
default          UGScIg            en0       
10.195.71/22       link#14            UCS               en0      !     link#14            UCS               en0      !        b4:c:25:e4:0:1     UHLWIir           en0   1185    link#14            UCS               en0      !       ae:d0:b5:cb:4c:bb  UHLWI             en0      !        UGHS              en0       
127                UCS               lo0          UH                lo0       
169.254            link#14            UCS               en0      !        UGSc              en0        UGSc              en0       
224.0.0/4          link#14            UmCSI             en0      ! link#14            UCSI              en0      !

The last rule seems fine and I expect all the packets that didn’t match any other rule to be sent throw interface en0, to the default gateway (

However, it looks like after I added and removed rules, the routing table list return to its original state (as seen above) but no packet were caught by the last rule. For example, when tried to ping or using traceroute, so it didn’t sent to the expected gateway and I got timeout.

restart the interfaces didn’t help. Only after adding specific rule for, using the following command sudo route add -ifp en0, the ping got response.

Perhaps anybody can think of a reason how can I check that my routing table output represent the real network state (I could use flush, but since adding specific rule resolved the problem, so I cannot think of a reason why the default gateway didn’t catch all packets that didn’t match previous rules)


Leave a comment

Name *
Add a display name
Email *
Your email address will not be published