User Tools

Site Tools


Using multiple public IPs on wan interface

Use case

Some users get from their ISP more than one routable public IP address.
In this case you need to assign these IPs to new wan interfaces and then add a DNAT and SNAT rule in firewall.
In our example we assume that our ISP assigned us (or with gateway wan interface already has the first available IP,, so we'll add .3, till .6 and they will be assigned to internal hosts on IPs 192.168.1.x

Configuration examples

Add a new wan interface in /etc/config/network:

config interface 'wan_3'
        option proto 'static'
        option ifname 'eth1'
        option ipaddr ''
        option netmask ''
        option gateway ''

Add DNAT (for incoming) and SNAT (for outgoing) connections in /etc/config/firewall:

config redirect
        option name 'dnat3'
        option src 'wan'
        option src_dip ''
        option dest 'lan'
        option dest_ip ''
        option proto 'all'
        option target 'DNAT'
config redirect
        option name 'snat3'
        option src 'lan'
        option src_ip ''
        option src_dip ''
        option dest 'wan'
        option proto 'all'
        option target 'SNAT'

Restart network and firewall services.

service network restart
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
docs/guide-user/network/wan/multiple_public_ips.txt · Last modified: 2019/12/09 09:14 by bobafetthotmail