Community discussions

MikroTik App
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Forwarding All Type of Traffic Through Specified Interface

Fri Feb 17, 2012 2:29 pm

Hello,

I have a local ISP connection that is failing to tracert to a certain ip address. The traffic to this ip address uses a specific port. My setup is as follows.

Ether 1 : 10.0.0.1/30 (WAN1)
Ether 2 : 10.10.0.1/30 (WAN2)
Ether 3 : 192.168.10.1/24 (LAN)

Ether 1 is the local ISP that is failing to reach this address. Ether 2 is another connection that is able to connect to the service.

How do I get all that specific traffic to only go through ether 2?

Thanks in advance.
 
vik1988
Member Candidate
Member Candidate
Posts: 235
Joined: Sun Oct 25, 2009 2:18 pm
Location: India

Re: Forwarding All Type of Traffic Through Specified Interfa

Sun Feb 19, 2012 8:02 am

Hi ,

Just add a single default route towards ether2 or you can use mangle rules for routing mark/route map.
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Forwarding All Type of Traffic Through Specified Interfa

Mon Feb 20, 2012 4:20 pm

sorry, being a bit of a nab myself i have been unable to get it working correctly. I have so far marked the connection, packet and route for smtp in mangle. Please could you send step by step info on how to get only smtp traffic through ether 2. that being said, I will need other specific web addresses and forwarded in the same manner at some stage.

thanks in advance.
 
vik1988
Member Candidate
Member Candidate
Posts: 235
Joined: Sun Oct 25, 2009 2:18 pm
Location: India

Re: Forwarding All Type of Traffic Through Specified Interfa

Wed Feb 22, 2012 10:56 am

/ip firewall mangle add chain=prerouting protocol=tcp dst-port=25 action=mark-routing new-routing-mark=smtp
/ip route add gateway=ether2 routing-mark=smtp
you can make it more specific by adding dst-address=<SMTP Address> in mangle rule.
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Forwarding All Type of Traffic Through Specified Interfa

Mon Feb 27, 2012 8:56 am

Thanks so much! will be trying this tomo. will get back to you.
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Forwarding All Type of Traffic Through Specified Interfa

Thu Mar 01, 2012 12:38 pm

Hi. I have tested and have been unsuccessful. For testing purposes i am using icmp in the code below instead of smtp. Included in this is my PPC settings. When i try to ping through ether2 from the mikrotik i get timeouts and dest host unreachable errors. I find it strange that the route dealing with 192.168.16.1 (ether2) is listed as static but not active.

# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 87.xxx.xxx.25 1
1 A S 0.0.0.0/0 192.168.16.1 1
2 A S 0.0.0.0/0 ether2 1
3 A S 0.0.0.0/0 87.xxx.xxx.25 1
4 S 0.0.0.0/0 192.168.16.1 2
5 ADC 87.xxx.xxx.24/29 87.xxx.xxx.27 ether1 0
6 ADC 192.168.1.0/24 192.168.1.1 ether3 0
7 ADC 192.168.16.0/24 192.168.16.222 ether2 0


0 chain=prerouting action=accept dst-address=87.xxx.xxx.24/29 in-interface=ether3

1 chain=prerouting action=accept dst-address=192.168.16.0/24 in-interface=ether3

2 chain=prerouting action=mark-connection new-connection-mark=new conn ether1 passthrough=yes in-interface=ether1 connection-mark=no-mark

3 chain=prerouting action=mark-connection new-connection-mark=new conn ether2 passthrough=yes in-interface=ether2 connection-mark=no-mark

4 chain=prerouting action=mark-connection new-connection-mark=ether1conn passthrough=yes dst-address-type=!local in-interface=ether3 connection-mark=no-mark
per-connection-classifier=both-addresses:2/0

5 chain=prerouting action=mark-connection new-connection-mark=ether2conn passthrough=yes dst-address-type=!local in-interface=ether3 connection-mark=no-mark
per-connection-classifier=both-addresses:2/1

6 chain=prerouting action=mark-routing new-routing-mark=toether1 passthrough=yes in-interface=ether3 connection-mark=ether1conn

7 chain=prerouting action=mark-routing new-routing-mark=toether2 passthrough=yes in-interface=ether3 connection-mark=ether2conn

8 chain=output action=mark-routing new-routing-mark=to ether 1 passthrough=yes connection-mark=ether1conn

9 chain=output action=mark-routing new-routing-mark=to ether 2 passthrough=yes connection-mark=ether2conn

10 X chain=prerouting action=mark-routing new-routing-mark=icmp passthrough=no protocol=icmp

Your help would be greatly appreciated.
 
vik1988
Member Candidate
Member Candidate
Posts: 235
Joined: Sun Oct 25, 2009 2:18 pm
Location: India

Re: Forwarding All Type of Traffic Through Specified Interfa

Thu Mar 01, 2012 6:17 pm

Hi,

why didn't u enable passthrough=yes in 10 Rule....
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Forwarding All Type of Traffic Through Specified Interfa

Fri Mar 02, 2012 8:42 am

I tried with and without pass through for testing. reconfirmed that this morning. When i specify ether 2 for icmp, dest. host unreachable errors come from the ip assigned to that interface.

any ideas? thanks for the help so far.
 
vik1988
Member Candidate
Member Candidate
Posts: 235
Joined: Sun Oct 25, 2009 2:18 pm
Location: India

Re: Forwarding All Type of Traffic Through Specified Interfa

Sat Mar 03, 2012 4:48 am

i have edited my code again
/ip firewall mangle add chain=prerouting protocol=tcp dst-port=25 place-before=0 action=mark-routing new-routing-mark=smtp
/ip route add gateway=ether2 routing-mark=smtp
so delete old rule and try this one...

or let try once by disabling other rule...
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: Forwarding All Type of Traffic Through Specified Interfa

Wed Mar 28, 2012 9:30 am

What about adding 2 forward rules allowing traffic from ether1 to ether2 and the other way around?
I am not sure but isn't the default forward behavior "drop"?
 
shahjs2002
just joined
Posts: 1
Joined: Thu Sep 25, 2008 11:53 am

Re: Forwarding All Type of Traffic Through Specified Interface

Thu Mar 09, 2017 11:41 pm

Hi all Experts, i have configure Mikrotik- CCR1036RM with 7 WAN Connection using PCC... but i am facing problem.. in all bank websites Govt Websites,,, and outlook, and webmail... because all are using SSL .. when we login receive msg your ip address change and not able to login... now we want only using WAN Interface-7 for Outlook, webmail, https websites to bypass load-balancing ... please help in this case.. what steps i need... i am new with Mikrotik so please little bit make it easy for me . thank you
 
User avatar
AYcoo
Frequent Visitor
Frequent Visitor
Posts: 93
Joined: Thu May 19, 2016 8:44 pm

Re: Forwarding All Type of Traffic Through Specified Interface

Wed Jun 21, 2017 5:43 pm

Hi all Experts, i have configure Mikrotik- CCR1036RM with 7 WAN Connection using PCC... but i am facing problem.. in all bank websites Govt Websites,,, and outlook, and webmail... because all are using SSL .. when we login receive msg your ip address change and not able to login... now we want only using WAN Interface-7 for Outlook, webmail, https websites to bypass load-balancing ... please help in this case.. what steps i need... i am new with Mikrotik so please little bit make it easy for me . thank you
you can use(policy routing rule) after you mark in route
in this way you link an ip to a wan

Who is online

Users browsing this forum: No registered users and 29 guests