Does Peplink Balance 20/30 support custom commands to custom ip tables, postrouting prerouting, nat, forward etc?


#1

I am currently using a DDWRT setup which supports custom Commands to handle Nat routing tables etc Does Peplink balance 20/30 handle something like this?

I want to switch to peplink because of multi wan and reliability but before I can do that I need to know if i am able to do something like this Thanks in Advance

/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1
/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1
/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1

/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.51 --sport 81 -j SNAT --to 69.x.x.x:80
/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.56 --sport 80 -j SNAT --to 69.x.x.x:80
/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.51 --sport 83 -j SNAT --to 69.x.x.x:80

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 10.x.x.x:81
/usr/sbin/iptables -I FORWARD -p tcp -d 10.x.x.x --dport 81 -j ACCEPT

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 10.x.x.x:80
/usr/sbin/iptables -I FORWARD -p tcp -d 100.x.x.x --dport 80 -j ACCEPT
/usr/sbin/iptables -I FORWARD -p tcp -s 100.x.x.x --sport 80 -j ACCEPT

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 100.x.x.x:83
/usr/sbin/iptables -I FORWARD -p tcp -d 100.x.x.x --dport 83 -j ACCEPT


#2

/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1
/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1
/usr/sbin/ip addr add 69.x.x.x/29 dxv vlan1

We support to put multiple interface IP addresses on WAN Interfaces. For LAN/VLAN on LAN, we support single Interface IP.

/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.51 --sport 81 -j SNAT --to 69.x.x.x:80
/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.56 --sport 80 -j SNAT --to 69.x.x.x:80
/usr/sbin/iptables -t nat -I POSTROUTING 1 -p all -s 10.x.x.51 --sport 83 -j SNAT --to 69.x.x.x:80

What is the usage of these POSTROUTING rules?

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 10.x.x.x:81
/usr/sbin/iptables -I FORWARD -p tcp -d 10.x.x.x --dport 81 -j ACCEPT

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 10.x.x.x:80
/usr/sbin/iptables -I FORWARD -p tcp -d 100.x.x.x --dport 80 -j ACCEPT
/usr/sbin/iptables -I FORWARD -p tcp -s 100.x.x.x --sport 80 -j ACCEPT

/usr/sbin/iptables -t nat -A PREROUTING -p tcp -d 69.x.x.x --dport 80 -j DNAT --to-destination 100.x.x.x:83
/usr/sbin/iptables -I FORWARD -p tcp -d 100.x.x.x --dport 83 -j ACCEPT

These PREROUTING rules are same as Inbound Access / Port Forwarding.

You can also go to our Web Admin demo site for details.


#3

Hi Thanks for the replay glad to confirm at least some of it will work . “Postrouting” rules are used to “Masquerade returned packets from the local ip to the public IP” This pages have some more details http://www.dd-wrt.com/wiki/index.php/One-to-one_NAT