Community discussions

MikroTik App
 
sysconfig
just joined
Topic Author
Posts: 7
Joined: Sat Jan 12, 2019 10:14 pm

heX with VLANs and trunk to a Router on a Stick (a transparent proxy) with PBR

Sat Feb 02, 2019 3:49 am

I'm trying to setup a rather unusual configuration on my heX (RB750Gr3):
[internet] - [DSL Router] 		 [heX :1]
                        		[heX :2] - untagged - [PC]
			 		[heX :3] - 
					[hex :4] - vlan 10 - [trunk] - [eth0.10 transparent Proxy]
					[hex :5] - vlan 20 - [trunk] - [eth0.20 transparent Proxy]

on a heX I need a PBR rule which redirects all TCP traffic to dst.port 80+443 from the port 2 to the transparent proxy (to its eth0.10 interface), which is a "router on a stick" - a PC with only one NIC and two VLANs. The HTTP/HTTPS traffic is processed on the transparent proxy and sent back using eth0.20 interface.

I fount a configuration example with an additional swith, but I wonder if it can be done with heX alone.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13055
Joined: Thu Mar 03, 2016 10:23 pm

Re: heX with VLANs and trunk to a Router on a Stick (a transparent proxy) with PBR  [SOLVED]

Sat Feb 02, 2019 2:04 pm

It can be done.
  • "router on a stick" (let's call it proxy) with the two VLANs should actually be connected to only one ether port on hEX. Let's say it'll be ether5
  • by default hEX has bridge with all ports but ether1 as members. You should remove ether5 from that bridge
  • configure VLAN interfaces on ether5:
    /interface vlan
    add interface=ether5 name=e5v10 vlan-id=10
    add interface=ether5 name=e5v20 vlan-id=20
    
  • configure IP addresses for both VLANs
    /ip address 
    add interface=e5v10 address=<router VLAN10 address>/24
    add interface=e5v20 address=<router VLAN20 address>/24
    
  • ideally both proxy's IP addresses will be in different LAN subnets, both different than "normal" LAN subnet.
    You can use smaller subnets for proxy's interfaces if you want (I don't see any benefit in doing it though, there are enough "standard sized" private subnets available)
  • after that you construct firewall filter/nat/mangle rules using IP addresses (of the client PC, both proxy's addresses, ...)
 
sysconfig
just joined
Topic Author
Posts: 7
Joined: Sat Jan 12, 2019 10:14 pm

Re: heX with VLANs and trunk to a Router on a Stick (a transparent proxy) with PBR

Wed Feb 06, 2019 12:33 am

It can be done.
Thank you, it worked!

Who is online

Users browsing this forum: No registered users and 22 guests