0

Case example for a router (or balancer, NAT gateway... etc):

  • LAN interface (say eth0) with IP 192.168.1.1 on 192.168.1.0/24 subnet. Acting as DHCP (and internet) server.
  • WAN interface (say eth1) with IP 192.168.1.100 on 192.168.1.0/24 subnet. Gateway is 192.168.1.1 (IP corresponding to, say, a DSL router).

Could this work?

If needed, I could add some scheme or graphic.

3

A router needs different subnets on its interfaces. If a router receives a packet with a destination address on an interface with the same subnet as the destination address, it will drop the packet unless the packet is addressed to the router's IP address. Also, a host will not send a packet to its gateway if the packet is destined for its local subnet unless the packet is specifically for the gateway's IP address.

You could do something like LAN - 192.168.1.0/25 and WAN - 192.168.1.128/25, but you need two completely different subnets.

Related to your question is the case where two companies with identical or overlapping subnets merge. In such a case, it is possible to connect routers from each of the merged companies using outside source NAT.

0

RFC 6598 specifies that the address range reserved for carrier-grade NAT "may be used in a manner similar to RFC 1918 private address space on routing equipment that is able to do address translation across router interfaces when the addresses are identical on two different interfaces."

Not all NAT devices support this kind of configution, but in principle, it is possible. The key is to distinguish network endpoints not only by the IP address but also by the device: if the router has two Ethernet devices, eth0 and eth1, 192.168.1.1%eth0 and 192.168.1.1%eth1 may be different endpoints and belong to different networks. It is then possible to implement NAT between these networks. It is not possible to route packets between the networks without NAT, because that would require distinct IP addresses.

I am not sure how one would configure this kind of NAT on Linux, for example, but I think it would involve selecting different routing tables based on the incoming interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.