Community discussions

MikroTik App
 
netraider
just joined
Topic Author
Posts: 4
Joined: Tue May 31, 2016 9:31 am

alternate gateway for static DHCP leases

Wed Sep 27, 2017 10:26 am

Hi all,

I've got standart DHCP server configuration for my LAN clients. But some clients have static leases and I need them to get other gateway IP, not the same as dinamic ones. How can I do it?

Thanks in advance
 
User avatar
Anumrak
Forum Guru
Forum Guru
Posts: 1174
Joined: Fri Jul 28, 2017 2:53 pm

Re: alternate gateway for static DHCP leases

Thu Oct 26, 2017 3:30 pm

You need create access list of dhcp static leases(f.e. Static)
Mark default route with routing mark:
/ip route
add distance=1 gateway="IP of your ISP for dhcp leases" routing-mark=ISP1-route(for example)
Mark traffic from LAN with mangle:
/ip firewall mangle
add src-address-list=Static action=mark-routing chain=prerouting connection-mark=dhcp-static \
in-interface=bridge(for example) new-routing-mark=ISP1-route
Mark traffic from Internet to your LAN:
/ip firewall mangle
add action=mark-connection chain=forward in-interface="your ISP interface for dhcp leases" \
new-connection-mark=dhcp-static passthrough=no

If you need connectivity from the Tik itself to the world behind this ISP:
/ip firewall mangle
add action=mark-connection chain=input in-interface="your ISP interface for dhcp leases" \
new-connection-mark=dhcp-static passthrough=yes
add action=mark-routing chain=output connection-mark=dhcp-static \
new-routing-mark=ISP1-route passthrough=no

If I wrong, please correct rules here.

Who is online

Users browsing this forum: Bing [Bot] and 41 guests