My IPv6 WAN interface gets an IPv6 address in addition to a prefix from my ISP. I'm hoping someone here could help me understand the purpose(s) this address serves. What sort of traffic goes to this address?
The first address should be the interface address, the second one - the PA space, provided (and routed) to you by the ISP, if implemented correctly.
What is the role of the interface address though? The clients on LAN get addresses based on the prefix delegated from the ISP, right? And they access the internet using their own addresses instead of the interface address like in the IPv4 NAT case.
So you have connectivity between your router and your ISP. LAN devices having a public address is no good if they don't have a gateway device to forward those packets to (i.e. your router) and if the gateway has no connectivity to the wider internet.
Aaah, that makes sense. Thanks!
The router's IP is used for connections which originate from the router. The most common type of these are DNS requests which were forwarded from the LAN. When LAN endpoints are configured to use the router as DNS, the DNS process in the router will make connection to a server on the Internet to resolve external addresses. It is typical practice to configure the network this way so that a repeat request for the same site can be answered quickly from a cache in the router.
Other times the router connects to the Internet are NTP connections to set its system time of day clock, and software updates when requested (OpenWrt doesn't automatically check for software updates).
To pile on to mk24's answer, think of your router as a local post office. That /128 is the address of the post office itself, so that it can receive packages of stamps or forms. Most of the time the post office just passes things along to it's service neighborhood (aka LAN), but sometimes it needs its own deliveries.
If you are still curious, and want to get your hands dirty, try this (assuming your WAN interface is on eth0
, change it in the ifconfig
command to suit):
opkg update ; opkg install tcpdump
host=$(ifconfig eth0 | awk '/\/128/ { print $3 }')
tcpdump -i eth0 host $host
Ctrl-C when you get tired of watching all the traffic between the router and the internet...
The router needs a global address to be able to ROUTE between LAN and WAN.
In networks where I.e. bgp or ospf is used it is possible to use only link local addresses but then the router would need at least a global known address on i.e. it's loopback interface but this maybe goes to deep down the rabbit hole.
The ISP assigns an address to the routers wan interface, and the delegated prefix is routed via this address.
For clients on the lan their gateway is from the prefix assigned to the lan interface. Because a gateway needs to be in from the subnet address space.
Linux should be able to use a global IPv6 address assigned to any other interface (since Linux uses a weak host model), if the WAN interface isn't assigned a global IPv6 address.
For IPv4... yes... for IPv6 I would not count that this works everytime.
That it is working for IPv4 was/is kind of an ugly hack.
Ipv6 neighbor discovery protocol is a totally different then ARP.
But what you encounter in the wild is a address on wan and this address is the next hop address for the prefix used on lan and wise versa.
Edit/add: a router still needs a nexthop for a prefix. As I stated earlier, it's possible to use a routing protocol and only link local addresses but you can't not use a address out of a prefix for a nexthop to this prefix.