You are not logged in.
# ip -4 route add 1.2.3.4/32 dev eth0
# ip -4 route
1.2.3.4 dev eth0 scope link
On the other hand, for IPv6:
# ip -6 route add 1:2:3::4/32 dev eth0
# ip -6 route
1:2::/32 dev eth0 metric 1024 pref medium
Any idea why is the prefix discarded for IPv4?
Last edited by mdeff (2021-01-09 17:28:30)
Offline
For IPv4 a /32 means there is no subnet because there are a maximum of 32 bits in the subnet so only the address is on the link.
Hence, scope link. The subnet isn't discarded as such, just described differently.
For IPv6 a /32 fits easily inside the maximum of 128 bits so you see a subnet.
Offline
You're right, thanks!
Offline