Community discussions

 
Kazek
newbie
Topic Author
Posts: 25
Joined: Mon Feb 12, 2018 12:53 pm

Routing /29 subnet

Wed Apr 17, 2019 9:36 pm

Hi!

I have a question about routing an extra /29 subnet I requested from my ISP.

The Mikrotik has a PPPoE connection to ISP with /32 address. Now I requested an extra subnet and have some troubles setting it up.

I know how to do that if I just want to set those 5 public IPs to devices connected to the router. Just set one IP on a Mikrotik interface as a gateway, create a static route and viola - works.
Like this:
/ip address
add address=xx.yyy.67.97/29 interface=ether7 network=xx.yyy.67.96
/ip route
add distance=1 dst-address=xx.yyy.67.96/29 gateway=[WAN interface to ISP]
Just connect a PC to ether7, set up static IP to f.e.xx.yyy.67.98 and we have a connection.

But right now I have few VLANs in a network and want to make each of them to use different IP from /29 subnet to "go out to the world". The reason is it's a hotel and if some guests have infected computers the ISP blocks the whole connection. This way I want to use the /32 purely for management without any traffic using this IP, only the once from /29.
How do I proceed with this?
 
mkx
Forum Guru
Forum Guru
Posts: 3183
Joined: Thu Mar 03, 2016 10:23 pm

Re: Routing /29 subnet

Wed Apr 17, 2019 10:01 pm

Use src-nat like this:
/ip firewall nat
add action=src-nat chain=srcnat src-address=<first subnet>/24 to-addresses=<public IP 1> out-interface-list=WAN
add action=src-nat chain=srcnat src-address=<second subnet>/24 to-addresses=<public IP 2> out-interface-list=WAN
....
# the last one will catch the remaining cases
add action=src-nat chain=srcnat to-addresses=<last public IP> out-interface-list=WAN
BR,
Metod
 
Kazek
newbie
Topic Author
Posts: 25
Joined: Mon Feb 12, 2018 12:53 pm

Re: Routing /29 subnet

Fri Apr 19, 2019 12:28 pm

Amazing! Works like a charm.
Thanks!

Who is online

Users browsing this forum: No registered users and 135 guests