Page 1 of 1

Split /24 public ip addresses

Posted: Fri Aug 09, 2019 5:25 am
by czsniper
Hi. How can i split an /24 public ip address to 1:8 private address.
Example of one private /24 address:
Gateway 192.168.0.1
mask: 255.255.255.0
clients from 192.168.0.2 to 192.168.0.8 goes to internet trough 86.123.123.1
clients from 192.168.0.8 to 192.168.0.15 goes to internet trough 86.123.123.2
clients from 192.168.0.16 to 192.168.0.23 goes to internet trough 86.123.123.3
and so one ...

Thank you !

Re: Split /24 public ip addresses  [SOLVED]

Posted: Fri Aug 09, 2019 8:12 am
by cdiedrich
Pretty straight forward:
/ip firewall address-list
add list=wan.1 address=192.168.0.2
add list=wan.1 address=192.168.0.3
...
add list=wan.2 address=192.168.0.9
add list=wan.2 address=192.168.0.10
...and so on

/ip firewall nat
add action=src-nat src-address-list=wan.1 to-address=add list=wan.1 address=86.123.123.1
add action=src-nat src-address-list=wan.2 to-address=add list=wan.1 address=86.123.123.2
...and so on.
-Chris

Re: Split /24 public ip addresses

Posted: Fri Aug 09, 2019 7:56 pm
by czsniper
Thanks Chris !