Setup for multiple Public IPs

Hi,
I have a problem where I am unable to split outgoing traffic to static public IPs.
From my ISP I have multible IPs
IP1: a.b.c.d/32
IP2: v.x.y.z/28 (Lets say v.x.y.z is the network v.x.y.z+1 is the gateway ip ISP router, v.x.y.z+n are the other available ips)
I did setup the wan interface to have all of the IPs. This seams to be working because If I enable ssh on the wan interface and try to connect via ssh I end up at the openwrt device.
I have defined multible subnets.
There is

  • lan 10.0.0.1/16
  • dev 10.10.0.1/16
  • dmz 10.20.0.1/16
    What I want to achieve is
  • outgoing traffic from lan subnet gets masqueraded to a.b.c.d
  • outgoing traffic from dev subnet gets masqueraded to v.x.y.z+2
  • outgoing traffic from dmz host1 (10.20.0.2) gets routet to v.x.y.z+3
  • outgoing traffic from dmz host2 (10.20.0.3) gets routet to v.x.y.z+4
  • outgoing traffic from dmz host3 (10.20.0.4) gets routet to v.x.y.z+5
  • outgoing traffic from dmz host4 (10.20.0.5) gets routet to v.x.y.z+6

I got the v.x.y.z+1 the gateway from my providers datasheet so this is fixed.
If I test my public IP from lan subnet I always get v.x.y.z+2 as my IP(the first IP entry in my wan interface) even if it should be a.b.c.d.
I also tried splitting the wan port into 2 entries and setting them in different zone on the firewall with no effect on the public IP.
I also tried setting up routing entries or NAT entries (via the gui) with either did not work at all or broke my internet connection completely.
Does someone have any idea how to set up I think this not so unusual setup?

Thanks
Michael

Research one-to-one nat or 1:1 nat

e.g.: https://wiki.dd-wrt.com/wiki/index.php/One-to-one_NAT

1 Like