What I have here is PPTP and L2TP users from different locations. Some are single computers, some are complete networks. A specific group of these connections get their routing marked as EV2
I was masquerading the connections to 193.239.149.97 via 87.229.53.253. Note that the base IP of the router is 87.229.53.254 (Please see red IP)
I was achieving this via a route rule #7 (please see red ROUTE) setting the source to 87.229.53.253. I have a corresponding NAT rule #2 (please see red NAT) and a MANGLE rule to handle the backward data flow #4 (please see red MANGLE)
This worked perfectly with routeros 2.9, but it doesn’t work in 3.0 . As I experienced the preferred source doesn’t work for ROUTE, so the packages were sent via 87.229.53.254 . I had to modify all rules accordingly .. but this is not what I need. I need to send these packages via 87.229.53.253.
This is the configuration:
IP ADDRESSES
Flags: X - disabled, I - invalid, D - dynamic
ADDRESS NETWORK BROADCAST INTERFACE
0 87.229.53.254/24 87.229.53.0 87.229.53.255 ether2
1 87.229.53.250/32 87.229.53.0 87.229.53.255 ether2
2 87.229.53.252/32 87.229.53.0 87.229.53.255 ether2
3 87.229.53.253/32 87.229.53.0 87.229.53.255 ether2
4 D 87.229.53.254/32 87.229.53.251 0.0.0.0 pptp-ev2mail
5 D 10.99.99.3/32 10.99.99.4 0.0.0.0 pptp-glucz-router
6 D 10.99.99.1/32 10.99.99.2 0.0.0.0 pptp-ev2-ronaut
[admin@EV2 - EPIA] >
As you can see there are some pptp users logged in.
MANGLE
0 chain=prerouting action=mark-routing new-routing-mark=ev2 passthrough=yes
dst-address=87.229.53.252 dst-port=90 protocol=tcp
1 chain=prerouting action=mark-routing new-routing-mark=ev2 passthrough=yes
dst-address=87.229.53.252 dst-port=7656 protocol=tcp
2 chain=prerouting action=mark-routing new-routing-mark=ev2 passthrough=no
in-interface=pptp-ev2-ronaut
3 chain=prerouting action=mark-routing new-routing-mark=ev2 passthrough=no
in-interface=pptp-glucz-router
4 chain=prerouting action=mark-routing new-routing-mark=ev2 passthrough=no
src-address=193.239.149.97 dst-address=87.229.53.253 in-interface=ether2
5 I chain=prerouting action=mark-routing new-routing-mark=luczkft passthrough=no
in-interface=pptp-ev2-GLroutolt
6 I chain=prerouting action=mark-routing new-routing-mark=luczkft passthrough=no
in-interface=l2tp-ev2-GLmasquerade
7 chain=prerouting action=mark-packet new-packet-mark=fromoutside passthrough=yes
in-interface=ether2
8 I chain=prerouting action=mark-routing new-routing-mark=luczkft passthrough=no
in-interface=l2tp-luczkft
9 I chain=prerouting action=mark-connection new-connection-mark=help passthrough=no
in-interface=l2tp-help-1
ROUTES
\
DST-ADDRESS PREF-SRC GATEWAY-STATE GATEWAY DISTANCE INTERFACE
0 A S 0.0.0.0/0 reachable 87.229.53.1 1 ether2
1 ADC 10.99.99.2/32 10.99.99.1 0 pptp-ev2-ronaut
2 ADC 10.99.99.4/32 10.99.99.3 0 pptp-glucz-router
3 ADC 87.229.53.0/24 87.229.53.254 0 ether2
4 ADC 87.229.53.251/32 87.229.53.254 0 pptp-ev2mail
5 A S 192.168.1.0/24 reachable 10.99.99.2 1 pptp-ev2-ronaut
6 A S 192.168.2.0/24 reachable 10.99.99.4 1 pptp-glucz-router
7 A S 193.239.149.97/32 87.229.53.253 reachable 87.229.53.1 1 ether2
NAT
0 chain=dstnat action=dst-nat to-addresses=192.168.1.75 to-ports=7656 dst-address=87.229.53.252 dst-port=8976 protocol=tcp
1 chain=dstnat action=dst-nat to-addresses=192.168.1.169 to-ports=90 dst-address=87.229.53.252 dst-port=80 protocol=tcp
2 ;;; EV2 masquerade
chain=srcnat action=masquerade routing-mark=ev2 connection-mark=!fixip
3 X ;;; Help accountok internet elerese
chain=srcnat action=masquerade connection-mark=help