What's new

Help setting up 1:1 nat - RT-AC88u

  • 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!

Gouldin

Regular Contributor
Hi all, have recently got an AC88u. Loving being back on Merlin's firmware. :)

I'm trying to setup 1:1 nat on my router. I know there are JFFS scripts, but even readin the FAQ for it (Which is well documented I must add) I'm at a loss with where to start.

My Current setup is:

BT Open Reach Modem -> RT-AC88U and in DD-WRT, my script goes like so:
Code:
# Save Startup
WANIF=`get_wanface`
ifconfig $WANIF:1 82.xx.xx.129 netmask 255.255.255.248 broadcast 82.xx.xx.xx
ifconfig $WANIF:2 82.xx.xx.130 netmask 255.255.255.248 broadcast 82.xx.xx.xx
ifconfig $WANIF:3 82.xx.xx.131 netmask 255.255.255.248 broadcast 82.xx.xx.xx
ifconfig $WANIF:4 82.xx.xx.132 netmask 255.255.255.248 broadcast 82.xx.xx.xx
ifconfig $WANIF:5 82.xx.xx.133 netmask 255.255.255.248 broadcast 82.xx.xx.xx






# Save Firewall

# WAN .129 -> LAN .5 (PS4 Pro -)
iptables -t nat -I PREROUTING -d xx.xx.xxx.129 -j DNAT --to 192.168.1.5
iptables -t nat -I POSTROUTING -s 192.168.1.5 -j SNAT --to xx.xx.xxx.129
iptables -I FORWARD -d 192.168.1.5 -j ACCEPT

# WAN .130 -> LAN .6 (WiiU -)
iptables -t nat -I PREROUTING -d xx.xx.xxx.130 -j DNAT --to 192.168.1.6
iptables -t nat -I POSTROUTING -s 192.168.1.6 -j SNAT --to xx.xx.xxx.130
iptables -I FORWARD -d 192.168.1.6 -j ACCEPT

# WAN .131 -> LAN .7 (Switch -)
iptables -t nat -I PREROUTING -d xx.xx.xxx.131 -j DNAT --to 192.168.1.7
iptables -t nat -I POSTROUTING -s 192.168.1.7 -j SNAT --to xx.xx.xxx.131
iptables -I FORWARD -d 192.168.1.7 -j ACCEPT

# WAN .132 -> LAN .8 (PS4 -)
iptables -t nat -I PREROUTING -d xx.xx.xxx.132 -j DNAT --to 192.168.1.8
iptables -t nat -I POSTROUTING -s 192.168.1.8 -j SNAT --to xx.xx.xxx.132
iptables -I FORWARD -d 192.168.1.8 -j ACCEPT

# WAN .133 -> LAN .9 (WiiU -)

iptables -t nat -I PREROUTING -d xx.xx.xxx.133 -j DNAT --to 192.168.1.9
iptables -t nat -I POSTROUTING -s 192.168.1.9 -j SNAT --to xx.xx.xxx.133
iptables -I FORWARD -d 192.168.1.9 -j ACCEPT

So,

I have enabled jffs, telnet. I have Putty. Anyone know how to convert this to work in Asus Merlin? :)
 
So far having sifted through other threads on the subject, I think I've got somewhere.

Nat-Start
Code:
#!/bin/sh

echo 'Start' >> /tmp/000start-nat

iptables -t nat -I PREROUTING -d xx.xx.xx.129 -j DNAT --to 192.168.1.5
iptables -t nat -I POSTROUTING -s 192.168.1.5 -j SNAT --to xx.xx.xx.129
iptables -t nat -I PREROUTING -d xx.xx.xx.130 -j DNAT --to 192.168.1.6
iptables -t nat -I POSTROUTING -s 192.168.1.6 -j SNAT --to xx.xx.xx.130
iptables -t nat -I PREROUTING -d xx.xx.xx.131 -j DNAT --to 192.168.1.7
iptables -t nat -I POSTROUTING -s 192.168.1.7 -j SNAT --to xx.xx.xx.131
iptables -t nat -I PREROUTING -d xx.xx.xx.132 -j DNAT --to 192.168.1.8
iptables -t nat -I POSTROUTING -s 192.168.1.8 -j SNAT --to xx.xx.xx.132
iptables -t nat -I PREROUTING -d xx.xx.xx.133 -j DNAT --to 192.168.1.8
iptables -t nat -I POSTROUTING -s 192.168.1.8 -j SNAT --to xx.xx.xx.133

echo 'End' >> /tmp/000start-nat

And

firewall-start
Code:
#!/bin/sh

for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 0 > $i ; done

iptables -I FORWARD -d 192.168.1.5 -j ACCEPT
iptables -I FORWARD -d 192.168.1.6 -j ACCEPT
iptables -I FORWARD -d 192.168.1.7 -j ACCEPT
iptables -I FORWARD -d 192.168.1.8 -j ACCEPT
iptables -I FORWARD -d 192.168.1.9 -j ACCEPT
iptables -t nat -I POSTROUTING -o br0 -s 192.168.0.0/16 -d 192.168.0.0/16 -j MASQUERADE

Am I on the right track? And how do I upload said files?
 
Ok, found this thread, which looks simpler.
https://www.snbforums.com/threads/configuring-multiple-static-wan-ips-through-one-to-one-nat.15300/

How do I save this and make it active on the router? (I can edit to my IP's no problem, just not sure how get jffs to run)
Code:
#!/bin/sh
#
# to restore this configuration, it needs to be saved to /jffs/scripts/nat-start
# on the router.
#
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
#
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
#
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
 

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