What's new

"Many to many" NAT, unique external IPv4 to one computer...

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

O

Ormu

Guest
Is it possible to give a unique external IPv4 address to one or more computers (preferably identified by their MAC addresses, not by the physical LAN port) in the local network with Asus routers (RT-N66U to be specific)? Other computers would still stay behind one IPv4 address.

Some Zyxel devices have more complex ways to do NAT, explained here, for example:
https://forums.techguy.org/threads/what-to-do-with-multiple-internet-ip-addresses.816621/
One to One: In One-to-One mode, the ZyXEL Device maps one local IP address to one global IP address.

Many to One: In Many-to-One mode, the ZyXEL Device maps multiple local IP addresses to one global IP address. This is equivalent to SUA (for instance, PAT, portaddress translation), ZyXEL's Single User Account feature that previous ZyXEL routers supported (the SUA Only option in today's routers).

Many to Many Overload: In Many-to-Many Overload mode, the ZyXEL Device maps the multiple local IP addresses to shared global IP addresses.

Many-to-Many No Overload: In Many-to-Many No Overload mode, the ZyXEL Device maps each local IP address to a unique global IP address.

Server: This type allows you to specify inside servers of different services behind the NAT to be accessible to the outside world.

Is there another name for this functionality, and is it available in Asus routers? Googling these terms doesn't seem to give much information, just something Zyxel-related.
 
Check my last 2 posts in this thread. I set this up last night ;)

https://www.snbforums.com/threads/help-setting-up-1-1-nat-rt-ac88u.37915/

You'll need to be running merlins firmware to do this and I followed this guide to create the file on the router and use my own script.

https://airvpn.org/topic/11264-asus-merlin-wrt-port-forwarding-script-setup/

Let me know if you have any issues.


Thanks. I'll check that out. But some questions I already have...

Does this method require static WAN IP addresses? I only get the IP addresses via DHCP and it's not guaranteed that they will stay the same.

The script you posted maps one local IP to one global IP. Is it possible to map multiple local IP addresses to a single global IP? I think my ISP provides 5 IPv4 addresses at most, and I may have more than five devices online at the same time.

Code:
#!/bin/sh
#
# to restore this configuration, it needs to be saved to /jffs/scripts/nat-start
# on the router.

#### Computer 1 ####
ifconfig ppp0:0 WanIP1 netmask 255.255.255.248 up
iptables -t nat -A PREROUTING -i ppp0 -d WanIP1 -j DNAT --to-destination 192.168.1.10
iptables -t nat -I POSTROUTING -s 192.168.1.10 -j SNAT --to WanIP1

#### Computer 2 ####
ifconfig ppp0:1 WanIP2 netmask 255.255.255.248 up
iptables -t nat -A PREROUTING -i ppp0 -d WanIP2 -j DNAT --to-destination 192.168.1.11
iptables -t nat -I POSTROUTING -s 192.168.1.11 -j SNAT --to WanIP2

#### All other computers #### 
ifconfig ppp0:2 WanIP3 netmask 255.255.255.248 up
iptables -t nat -A PREROUTING -i ppp0 -d WanIP3 -j DNAT --to-destination 192.168.1.12   ##  ????
iptables -t nat -I POSTROUTING -s 192.168.1.12 -j SNAT --to WanIP3                             ##  ????


# Port forwards, in case the webui doesn't work, but i think it will.  uncomment below if needed.
# iptables -A FORWARD -p tcp --dport 80 -d 192.168.1.10 -j ACCEPT

Does it work if I put an IP range to the source/destination fields, e.g. --to-destination 192.168.2.0/8 ?



Thank goodness IPv6 is coming. Too bad it's happening so painfully slowly...
 
Last edited by a moderator:
Sorry for the late reply.

Haven't had a chance to test it for a range of ip's. I'll give it a go at the weekend when I can have some downtime on my setup.
 
Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top