Using multiple WAN IPs

  • Some users get from their ISP more than one routable public IP address.
  • Assume that the WAN IPs are,, etc.
  • Utilize multiple WAN IPs on the same interface.
  • Use a specific WAN IP for a specific LAN host.

Create an alias for the WAN interface.

uci -q delete network.wan3
uci set network.wan3="interface"
uci set network.wan3.proto="static"
uci set network.wan3.device="@wan"
uci set network.wan3.ipaddr=""
uci commit network
service network restart

Configure destination and source NAT firewall rules.

uci -q delete firewall.dnat3
uci set firewall.dnat3="redirect"
uci set"DNAT3"
uci set firewall.dnat3.src="wan"
uci set firewall.dnat3.src_dip=""
uci set firewall.dnat3.dest="lan"
uci set firewall.dnat3.dest_ip=""
uci set firewall.dnat3.proto="all"
uci set"DNAT"
uci -q delete firewall.snat3
uci set firewall.snat3="nat"
uci set"SNAT3"
uci set firewall.snat3.src="wan"
uci set firewall.snat3.src_ip=""
uci set firewall.snat3.snat_ip=""
uci set firewall.snat3.proto="all"
uci set"SNAT"
uci commit firewall
service firewall restart
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2023/10/14 06:10
  • by vgaetera