On 08/08/17 00:47, Fil wrote: > > Joonas Kylmälä wrote: >> Think about the 1% who do not use NAT (actually in Finland the ISPs give >> usually 5 IPv4 addresses so it might not be too uncommon). You mentioned >> earlier the link local addresses so we could make a list of similar >> non-working IPv4 addresses (in case there are others) and then check if >> the address belongs to that list and act accordingly. The function >> isLinkLocalAddress() can be used. > > I didn't know about the situation in Finland. I'm still doubtful about > those public addresses being actually assigned directly to your WLAN > interface, but I guess I don't know enough to assume they're not. Let's > say we need to consider that 1% chance too..
This wasn't too uncommon in other countries in the 1990s amongst 'professional/business' ISPs until it became clear the IPv4 address space was becoming scarce. What usually happened is the ISP allocated a /29 sub-net: 255.255.255.255 = /32 = 1 address 255.255.255.254 = /31 = 2 addresses 255.255.255.253 = /30 = 4 addresses 255.255.255.252 = /29 = 8 addresses To further complicate matters usually the CPE router would be allocated a single /32 IP address from another range entirely. It would be the responsibility of the customer to configure and allocate the /29 sub-net either statically or using DHCP. The default route would be the IP address of the CPE router, so: A <Internet> 0.0.0.0/0 B <ISP gateway> a.b.c.d/32 default via dev A, i.j.k.l/29 via e.f.g.h dev C C <CPE gateway> e.f.g.h/32 default via a.b.c.d, i.j.k.l/29 via dev D D <LAN PCs> i.j.k.l/29 default via e.f.g.h Of the 8 addresses only 5 are usable for routing because: 0 = i.j.k.l = sub-net address 1 = i.j.k.l+1 = usually the CPE router's LAN address 2 = i.j.k.l+2 } ... }- allocated to devices on the LAN 6 = i.j.k.l+6 } 7 = i.j.k.l+7 = sub-net broadcast address _______________________________________________ Replicant mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/replicant
