OK. Forget about terms.
At this moment I have 4 active interfaces
/ip address
add address=192.168.0.4/24 interface=ether1-Optional-Net network=192.168.0.0
add address=172.26.101.4/24 interface=ether4-DMZ network=172.26.101.0
add address=192.168.1.1/24 interface=ether5-Office-Net network=192.168.1.0
add address=192.168.14.1/24 interface=ether3-Public-Net network=192.168.14.0
Interface ether4-DMZ is default gate.
/ip route
add distance=1 gateway=172.26.101.2
NAT for default route is OFF.
But it is ON for ether1-Optional-Net. (Some resources from this net need to be available from local network, without changing configuration of Optional net)
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes to-addresses=0.0.0.0
add action=masquerade chain=srcnat dst-address=192.168.0.0/24 out-interface=ether1-Optional-Net src-address=192.168.14.
add action=masquerade chain=srcnat dst-address=192.168.0.0/24 out-interface=ether1-Optional-Net src-address=192.168.1.0
And Web Proxy is OFF also.
/ip proxy
set parent-proxy=0.0.0.0
Local network interfaces (ether5-Office-Net and ether3-Public-Net network) have hotspot with UserMan identifications.
Universal NAT is disabled for ether5-Office-Net.
/ip hotspot profile
add dns-name=public.inet hotspot-address=192.168.14.1 html-directory=hotspot.inet login-by=http-chap,https,http-pap name=public.hs.profile use-radius=yes
add dns-name=office.inet hotspot-address=192.168.1.1 html-directory=hotspot.inet login-by=http-chap,https,http-pap name=office.hs.profile use-radius=yes
/ip hotspot
add address-pool=Public-Net-pool disabled=no interface=bridge-Public-Net name=Public-Hotspot profile=public.hs.profile
add disabled=no interface=ether5-Office-Net name=Office-Hotspot profile=office.hs.profile
/ip hotspot user profile
set [ find default=yes ] idle-timeout=10m insert-queue-before=hotspot-users-rules mac-cookie-timeout=3d session-timeout=3h20m
I think configuration is clear. Now let’s make tests.
I will try to open site http://forum.mikrotik.com (159.148.147.201) from computer which connected to ether5-Office-Net and will monitor connections from Mikrotik on my firewall interface (172.26.101.2).
tcpdump -i le0 'tcp[tcpflags] & (tcp-syn) != 0 and host 159.148.147.201'
Test 1. No any proxy settings on client computer.
Result: Site was opened without problem and log is showing no any NAT between client and firewall.
All traffic was originated from original source IP (192.168.1.61)
13:34:46.559538 IP 192.168.1.61.4493 > tuncis.mt.lv.http: Flags [S], seq 1194333346, win 65535, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
13:34:47.671713 IP 192.168.1.61.4495 > tuncis.mt.lv.http: Flags [S], seq 4103440868, win 65535, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
13:34:48.972472 IP tuncis.mt.lv.http > 192.168.1.61.4493: Flags [S.], seq 3292920672, ack 1194333347, win 65228, options [mss 1460,nop,wscale 7,sackOK,TS val 715220277 ecr 0], length 0
13:34:49.463431 IP tuncis.mt.lv.http > 192.168.1.61.4495: Flags [S.], seq 348353262, ack 4103440869, win 65228, options [mss 1460,nop,wscale 7,sackOK,TS val 3446909092 ecr 0], length 0
….
Test 2. Proxy is activated in browser on client computer (172.26.101.2:3128)
Result: After passing hotspot login page – I have error message
Request denied by Proxy Server: 403 Forbidden
Reason: Access to site is blocked. Client address: 172.26.101.4
Client group: default
Target group: 82059
URL: http://forum.mikrotik.com/viewtopic.php?f=2
(transparent proxy is activated on firewall site and all connection from Mikrotik IP is prohibited)
And tcpdump is confirming than connection is now going from Mikrotik IP (router=172.26.101.4, not from client IP):
13:48:02.834014 IP router.59200 > tuncis.mt.lv.http: Flags [S], seq 2390002386, win 14600, options [mss 1460,sackOK,TS val 4294953119 ecr 0,nop,wscale 4], length 0
13:48:02.834115 IP tuncis.mt.lv.http > router.59200: Flags [S.], seq 1329855587, ack 2390002387, win 65228, options [mss 1460,nop,wscale 7,sackOK,TS val 1343130535 ecr 4294953119], length 0
Something is now making masquerading or proxying traffic inside of Mikrotik.
Test 3. Proxy is activated in client browser. And I deny forum IP inside of Mikrotik proxy and Mikrotik Web proxy is still NOT enabled.
/ip proxy
set parent-proxy=0.0.0.0
/ip proxy access
add action=deny dst-address=159.148.147.201
Result: Client browser show message from Mikrotik:
ERROR: Forbidden
While trying to retrieve the URL http://forum.mikrotik.com/t/how-turn-off-universal-proxy/74429/1
Access Denied
Your cache administrator is webmaster.
Generated Mon, 03 Mar 2014 14:05:11 GMT by 192.168.1.1 (Mikrotik HttpProxy)
And no any traffic tcpdump logged.
Test 4. I turn off proxy in client browser, but Mikrotik proxy settings the same as in test 3.
Result: Site was opened and tcpdump show correct traffic (no any transparent proxy in Mikrotik)
15:18:07.882427 IP 192.168.1.61.4750 > tuncis.mt.lv.http: Flags [S], seq 809050715, win 65535, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
15:18:07.882544 IP tuncis.mt.lv.http > 192.168.1.61.4750: Flags [S.], seq 4037620847, ack 809050716, win 65228, options [mss 1460,nop,wscale 7,sackOK,TS val 2164858298 ecr 0], length 0
15:18:16.735943 IP 192.168.1.61.4752 > tuncis.mt.lv.http: Flags [S], seq 1298546553, win 65535, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
15:18:16.739448 IP 192.168.1.61.4755 > tuncis.mt.lv.http: Flags [S], seq 977636447, win 65535, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
Summary:
For some reason Miktotik is forwarding HTTP traffic via internal Web Proxy when client is trying to use outside proxy server.
/ip proxy> print
enabled: no (!!!!!!!)
src-address: ::
port: 8080
parent-proxy: 0.0.0.0
parent-proxy-port: 0
cache-administrator: webmaster
max-cache-size: unlimited
max-cache-object-size: 2048KiB
cache-on-disk: no
max-client-connections: 600
max-server-connections: 600
max-fresh-time: 3d
serialize-connections: no
always-from-cache: no
cache-hit-dscp: 4
cache-drive: system
/ip proxy> monitor
status: stopped
uptime: 2h22m42s
requests: 7412 (!!!!!!!)
hits: 0
cache-used: 0KiB
total-ram-used: 128KiB
received-from-servers: 768KiB
sent-to-clients: 727KiB
hits-sent-to-clients: 0KiB
As per Mikrotik manual (http://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot) it is “Universal Proxy technique” (I first time read this term from above link).
So my question – somebody know how to turn off or block above described behavior?