V
V
Vladislav2015-08-11 11:34:19
Mikrotik
Vladislav, 2015-08-11 11:34:19

Mikrotik Mangle, 3 ip addresses on one port?

The provider gives 3 external addresses: 1.1.1.1; 2.2.2.1; 3.3.3.1
It is necessary:
​​to allocate 1 address for users 192.168.0.0/24 on the Internet;
2 allocate an address for a mail server with ip 192.168.0.15
3. allocate an address for gre-tunnels
How do I set up labeling?
Here is what is written in Mangle:
0 chain=input action=mark-connection new-connection-mark=gre-in
passthrough=no dst-address=2.2.2.1 in-interface=eth1
log=no log-prefix=""
1 chain =output action=mark-routing new-routing-mark=gre-out
passthrough=no connection-mark=gre-in log=no log-prefix=""
2 chain=input action=mark-connection new-connection-mark= mail-in
passthrough=no dst-address=3.3.3.1 in-interface=eth1
log=no log-prefix=""
3 chain=output action=mark-routing new-routing-mark=mail-out
passthrough=no connection-mark=mail -in log=no log-prefix=""
And routes accordingly:
0 AS dst-address=0.0.0.0/0 gateway=1.1.1.2
gateway-status=1.1.1.2 reachable via eth1
check-gateway=arp distance=1 scope =30 target-scope=10
1 AS dst-address=0.0.0.0/0 gateway=2.2.2.2
gateway-status=2.2.2.2 reachable via eth1
check-gateway=arp distance=1 scope=30 target-scope=10
routing -mark=gre-out
2 AS dst-address=0.0.0.0/0 gateway=3.3.3.2
gateway-status=3.3.3.2 reachable via ether1 check-gateway=arp
distance=1 scope=30 target-scope=10 routing-mark=mail-out
And as a result, outgoing gre traffic for some reason goes through route 1.1.1.2. Tell me what else needs to be added to Mangle.
3015aa07071246df8e4cdb53f782a938.png0deb4d5e3a904e76952d9d93053f0662.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cool Admin, 2015-08-11
@ifaustrue

I don't see the pref-src parameter in your routing tables. Without it, the router will send outgoing chain packets from the lowest address.
Also, for conditions 1 and 2, you need to create SRC NAT rules, but I think you did it anyway.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question