What's new

Is one to one NAT possible with Asuswrt?

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

waspinator

New Around Here
Hi,

I'm trying to set up my multiple public IPs to point to multiple private IPs. This is useful for me since I have a few 'servers' that all use the same ports. I know I could use port forwarding with port translation, but I don't want people to have to enter custom ports.

Is there a way to configure Asuswrt in a similar way to this guide?
http://www.dd-wrt.com/wiki/index.php/One-to-one_NAT

Thanks
 

I tried copying the script into
Code:
/jffs/scripts/nat-start
and running
Code:
chmod a+rx /jffs/scripts/*
but I can't access the computers using the external IP...

Code:
#!/bin/sh
#
#/jffs/scripts/nat-start
#
# router WAN configuration
# ------------------------
# Static IP
# X.X.X.X.30

## WAN X.X.X.X.31 -> LAN 10.34.1.4
ifconfig eth0:0 X.X.X.X.31 netmask 255.255.255.0 up
iptables -t nat -A PREROUTING -i eth0 -d X.X.X.X.31 -j DNAT --to-destination 10.34.1.4
iptables -t nat -I POSTROUTING -s 10.34.1.4 -j SNAT --to X.X.X.X.31
# open ports 80 and 443
iptables -A FORWARD -i eth0 -p tcp --dport 80 -d 10.34.1.4 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 443 -d 10.34.1.4 -j ACCEPT

## WAN X.X.X.X.32 -> LAN 10.34.1.5
ifconfig eth0:1 X.X.X.X.32 netmask 255.255.255.0 up
iptables -t nat -A PREROUTING -i eth0 -d X.X.X.X.32 -j DNAT --to-destination 10.34.1.5
iptables -t nat -I POSTROUTING -s 10.34.1.5 -j SNAT --to X.X.X.X.32
# open ports 80 and 443
iptables -A FORWARD -i eth0 -p tcp --dport 80 -d 10.34.1.5 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 443 -d 10.34.1.5 -j ACCEPT

## WAN X.X.X.X.33 -> LAN 10.34.1.6
ifconfig eth0:2 X.X.X.X.33 netmask 255.255.255.0 up
iptables -t nat -A PREROUTING -i eth0 -d X.X.X.X.33 -j DNAT --to-destination 10.34.1.6
iptables -t nat -I POSTROUTING -s 10.34.1.6 -j SNAT --to X.X.X.X.33
# open ports 80 and 443
iptables -A FORWARD -i eth0 -p tcp --dport 80 -d 10.34.1.6 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 443 -d 10.34.1.6 -j ACCEPT

I tested to see if the ports were open using yougetsignal and they are all closed.

How would I use the webUI to forward ports from each WAN IP to each LAN IP?

Thanks

edit

typing `ifconfig` into the terminal does not show any extra eth0 configured interfaces. this is the only eth0 entry

Code:
eth0       Link encap:Ethernet  HWaddr AC:XX:XX:XX:XX:XX  
           inet addr:X.X.X.30  Bcast:X.X.X.255  Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:58487 errors:0 dropped:0 overruns:0 frame:0
           TX packets:52620 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000 
           RX bytes:8369465 (7.9 MiB)  TX bytes:19643974 (18.7 MiB)
           Interrupt:4 Base address:0x2000

dmesg | grep eth0 doesn't mention anything interesting either

Code:
# dmesg | grep eth0
eth0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.110.27.20012
device eth0 entered promiscuous mode

is there a way to check if the router is doing anything, where it's failing, or where I have errors in the script? should I be putting things in another place? https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

edit2

If I copy and paste each command into the terminal then the port forwarding works as expected. is the nat-start file supposed to have a file extension? if so what should it be? Is there a place I can just copy and paste the script into the webUI?

edit3

and it works. I must have had the wrong encoding in the file. I copied the text, deleted the file, and created a new one using vi and pasting it back in.

out of curiosity are there any firmware versions available for our routers that have a webUI to help out with this kind of set up?

Thanks
 
Last edited:

Similar threads

Sign Up For SNBForums Daily Digest

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