/ip address
add address=1.1.1.2/24 disabled=no interface=outside1
add address=1.1.2.2/24 disabled=no interface=outside2
add address=10.0.0.1/24 disabled=no interface=hotspot
add address=10.0.1.1/24 disabled=no interface=hotspot2
/ip firewall address-list
add address=10.0.0.0/24 disabled=no list=Local_NAT_Networks
add address=10.0.1.0/24 disabled=no list=Local_NAT_Networks
/ip firewall mangle
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside1 new-connection-mark=outside1_connection passthrough=yes
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside2 new-connection-mark=outside2_connection passthrough=yes
add action=mark-routing chain=output connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes
add action=mark-routing chain=output connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes
add action=accept chain=prerouting disabled=no dst-address=1.1.1.0/24 src-address-list=Local_NAT_Networks
add action=accept chain=prerouting disabled=no dst-address=1.1.2.0/24 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside1_connection passthrough=yes per-connection-classifier=src-address:2/0 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside2_connection passthrough=yes per-connection-classifier=src-address:2/1 src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes src-address-list=Local_NAT_Networks
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-mark=to_outside1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=1.1.2.1 routing-mark=to_outside2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=5 dst-address=0.0.0.0/0 gateway=1.1.1.1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=1.1.2.1 scope=30 target-scope=10
Yes, it will. It's the exact same mangle rules, just build the address-list Local_NAT_Networks with only one network. You could change the rules to refer to the LAN directly, but I see no benefit to that - using those rules as is allows you to expand to more LANs just by adding interfaces and adding the networks to the address-list.hello folks,
this post is meant for 2 isp and 2 lan, can it work for 2 isp and one lan ,
pls post the rules for that and also that will work with hotspot.
thanks
/ip address
add address=1.1.1.2/24 disabled=no interface=outside1
add address=1.1.2.2/24 disabled=no interface=outside2
add address=10.0.0.1/24 disabled=no interface=hotspot
/ip firewall address-list
add address=10.0.0.0/24 disabled=no list=Local_NAT_Networks
/ip firewall mangle
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside1 new-connection-mark=outside1_connection passthrough=yes
add action=mark-connection chain=input connection-state=new disabled=no in-interface=outside2 new-connection-mark=outside2_connection passthrough=yes
add action=mark-routing chain=output connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes
add action=mark-routing chain=output connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes
add action=accept chain=prerouting disabled=no dst-address=1.1.1.0/24 src-address-list=Local_NAT_Networks
add action=accept chain=prerouting disabled=no dst-address=1.1.2.0/24 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside1_connection passthrough=yes per-connection-classifier=src-address:2/0 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside2_connection passthrough=yes per-connection-classifier=src-address:2/1 src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes src-address-list=Local_NAT_Networks
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-mark=to_outside1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=1.1.2.1 routing-mark=to_outside2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=5 dst-address=0.0.0.0/0 gateway=1.1.1.1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=1.1.2.1 scope=30 target-scope=10
/ip hotspot profile
set default dns-name="" hotspot-address=0.0.0.0 html-directory=hotspot http-proxy=0.0.0.0:0 login-by=http-pap name=default rate-limit="" smtp-server=0.0.0.0 split-user-domain=no \
ssl-certificate=none use-radius=no
add dns-name=hotspot.example.com hotspot-address=0.0.0.0 html-directory=hotspot http-proxy=0.0.0.0:0 login-by=https name=hotspot rate-limit=5m/5m smtp-server=0.0.0.0 \
split-user-domain=no use-radius=no
/ip hotspot
add disabled=no idle-timeout=30m interface=hotspot keepalive-timeout=5m name=hotspot profile=hotspot
/ip hotspot user profile
set default idle-timeout=none keepalive-timeout=2m name=default rate-limit=64k/64k shared-users=unlimited status-autorefresh=1m transparent-proxy=no
add idle-timeout=none keepalive-timeout=15m name=hotspot rate-limit=1m/1m shared-users=unlimited status-autorefresh=1m transparent-proxy=no
/ip hotspot service-port
set ftp disabled=no ports=21
/ip hotspot user
add comment="" disabled=no name=hotspot password=hotspot profile=hotspot
/ip hotspot walled-garden ip
add action=accept comment="Allow hotspot users to ping for troubleshooting purposes" disabled=no protocol=icmp
/ip pool
add name=DHCP-Pool-Hotspot ranges=10.0.0.2-10.0.0.254
/ip dhcp-server
add address-pool=DHCP-Pool-Hotspot authoritative=yes bootp-support=static disabled=no interface=hotspot lease-time=3h name=DHCP-Hotspot
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=10.0.0.0/24 comment="" dns-server=10.0.0.1 domain=example.com gateway=10.0.0.1
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 primary-dns=1.1.1.3 secondary-dns=1.1.2.3
/ip dns static
add address=10.0.0.1 disabled=no name=hotspot.example.com ttl=1d
/ip firewall nat
add chain=srcnat action=masquerade disabled=no out-interface=outside1
add chain=srcnat action=masquerade disabled=no out-interface=outside2
/ip dns set allow-remote-request=yes
/ip hotspot walled-garden ip add protocol=udp dst-port=53 action=accept
/ip firewall filter add chain=input action=accept protocol=udp dst-port=53 place-before=0
/ip hotspot profile
set default dns-name="" hotspot-address=0.0.0.0 html-directory=hotspot http-cookie-lifetime=3d http-proxy=0.0.0.0:0 login-by=cookie,http-chap name=default rate-limit="" smtp-server=0.0.0.0 split-user-domain=no use-radius=no
add dns-name="" hotspot-address=10.0.0.1 html-directory=hotspot http-cookie-lifetime=3d http-proxy=0.0.0.0:0 login-by=cookie,http-chap name=hsprof1 rate-limit="" smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot
add address-pool=pool1 addresses-per-mac=2 disabled=no idle-timeout=5m interface=wlan1 keepalive-timeout=none name=hotspot1 profile=hsprof1
/ip hotspot user profile
set default idle-timeout=none keepalive-timeout=2m name=default shared-users=1 status-autorefresh=1m transparent-proxy=no
/ip hotspot service-port
set ftp disabled=no ports=21
/ip hotspot user
add comment="" disabled=no name=admin password=password profile=default
/ip hotspot walled-garden ip
add action=accept comment="" disabled=no protocol=icmp
add action=accept comment="" disabled=no dst-port=53 protocol=udp
/ip firewall address-list
add address=10.0.0.0/24 comment="" disabled=no list=Local_NAT_Networks
/ip firewall connection tracking
set enabled=yes generic-timeout=10m icmp-timeout=10s tcp-close-timeout=10s tcp-close-wait-timeout=10s tcp-established-timeout=1d tcp-fin-wait-timeout=10s tcp-last-ack-timeout=10s tcp-syn-received-timeout=5s tcp-syn-sent-timeout=5s tcp-syncookie=no \
tcp-time-wait-timeout=10s udp-stream-timeout=3m udp-timeout=10s
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
/ip firewall mangle
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=ether1 new-connection-mark=outside1_connection passthrough=yes
add action=mark-connection chain=input comment="" connection-state=new disabled=no in-interface=ether2 new-connection-mark=outside2_connection passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes
add action=accept chain=prerouting comment="" disabled=no dst-address=192.168.16.0/24 src-address-list=Local_NAT_Networks
add action=accept chain=prerouting comment="" disabled=no dst-address=192.168.50.0/24 src-address-list=Local_NAT_Networks
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside1_connection passthrough=yes per-connection-classifier=src-address:2/0 src-address-list=\
Local_NAT_Networks
add action=mark-connection chain=prerouting comment="" connection-state=new disabled=no dst-address-type=!local hotspot=auth new-connection-mark=outside2_connection passthrough=yes per-connection-classifier=src-address:2/1 src-address-list=\
Local_NAT_Networks
add action=mark-routing chain=prerouting comment="" connection-mark=outside1_connection disabled=no new-routing-mark=to_outside1 passthrough=yes src-address-list=Local_NAT_Networks
add action=mark-routing chain=prerouting comment="" connection-mark=outside2_connection disabled=no new-routing-mark=to_outside2 passthrough=yes src-address-list=Local_NAT_Networks
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="masquerade hotspot network" disabled=no src-address=10.0.0.0/24
/ip firewall service-port
set ftp disabled=no ports=21
set tftp disabled=no ports=69
set irc disabled=no ports=6667
set h323 disabled=no
set sip disabled=no ports=5060,5061
set pptp disabled=no
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512 primary-dns=67.91.XX.XX secondary-dns=67.91.XX.XX
/ip dhcp-server
add address-pool=pool1 authoritative=after-2sec-delay bootp-support=static disabled=no interface=wlan1 lease-time=3d name=server1
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=10.0.0.0/24 comment="hotspot network" gateway=10.0.0.1
[admin@wfgy-wfgtwoharbomn-02] > /interface print detail
Flags: D - dynamic, X - disabled, R - running, S - slave
0 R name="ether1" type="ether" mtu=1500 l2mtu=1526
1 R name="ether2" type="ether" mtu=1500 l2mtu=1522
2 name="ether3" type="ether" mtu=1500 l2mtu=1522
3 R name="wlan1" type="wlan" mtu=1500 l2mtu=2290
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
0 A S dst-address=0.0.0.0/0 gateway=192.168.16.1 gateway-status=192.168.16.1 reachable ether1 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_outside1
1 A S dst-address=0.0.0.0/0 gateway=192.168.50.1 gateway-status=192.168.50.1 reachable ether2 check-gateway=ping distance=1 scope=30 target-scope=10 routing-mark=to_outside2
2 A S dst-address=0.0.0.0/0 gateway=192.168.16.1 gateway-status=192.168.16.1 reachable ether1 check-gateway=ping distance=5 scope=30 target-scope=10
3 S dst-address=0.0.0.0/0 gateway=192.168.50.1 gateway-status=192.168.50.1 reachable ether2 check-gateway=ping distance=10 scope=30 target-scope=10
4 ADC dst-address=10.0.0.0/24 pref-src=10.0.0.1 gateway=wlan1 gateway-status=wlan1 reachable distance=0 scope=10
5 ADC dst-address=192.168.16.0/24 pref-src=192.168.16.25 gateway=ether1 gateway-status=ether1 reachable distance=0 scope=10
6 ADC dst-address=192.168.50.0/24 pref-src=192.168.50.25 gateway=ether2 gateway-status=ether2 reachable distance=0 scope=10
How i can create the nat rule? i have the same problem with 3 wan load balance PCC + 1 lan with hotspot. but the hotspot dont redirect to login page, i try to put the ip directly on the webbroser and i can login sucess and browse internet fine, the only problem is the redirect hotspot login page. help pleaseWe got it working.....
The problem is that the host computer I was using had a statically defined DNS server, while using DHCP for the IP and gateway, the DNS proxy does not work. Setting DNS to DHCP, instead of static, and I can
Creating a NAT rule to simply pass through DNS traffic, instead of using the proxy, and everything works fine.
fewi you can explain why you use the DNS 1.1.1.3?? 1.1.2.3? i can use 1.1.11 and 1.1.2.1??That post contains the configuration. There is nothing else to send.
How i can create the nat rule? i have the same problem with 3 wan load balance PCC + 1 lan with hotspot. but the hotspot dont redirect to login page, i try to put the ip directly on the webbroser and i can login sucess and browse internet fine, the only problem is the redirect hotspot login page. help pleaseWe got it working.....
The problem is that the host computer I was using had a statically defined DNS server, while using DHCP for the IP and gateway, the DNS proxy does not work. Setting DNS to DHCP, instead of static, and I can
Creating a NAT rule to simply pass through DNS traffic, instead of using the proxy, and everything works fine.
/ip firewall nat
add action=accept chain=hotspot comment="Allow DNS to pass through for guests \
that have been authed on the network." disabled=no dst-port=53 hotspot=\
auth protocol=udp
add action=accept chain=hotspot comment="" disabled=no dst-port=53 hotspot=\
auth protocol=tcp