Community discussions

MikroTik App
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Route IP out differente gateway

Thu Jan 14, 2016 3:42 pm

Please can someone help me.

I am struggling with something so simple.

I have my mikrotik as my main router in the office.

Currently all traffic is NATed out of my PPPoE_1 Client connection.

I have recently added a VoIP PBX to the network. So I have obtained another ADSL line, and set it up as PPPoE_2.

It is connecting and all is well.

How do I now Route All traffic from PBX IP or Range or Address List out of PPPoE_2 ?


From my understanding I have to add a mangle rule to park the packets. and then a new static route with a routing mark?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Route IP out differente gateway

Thu Jan 14, 2016 5:09 pm

If you ONLY want to do policy routing for the outbound traffic from the SIP pbx, then you can probably get away with a simplified mangling configuration. I'm assuming that

/ip firewall mangle
add chain=prerouting src-address-list=ISP2hosts action=mark-routing new-routing-mark=ISP2

Then add whatever IP addresses/ranges to the address list ISP2hosts that you like.

In the routing table, create a static route dst=0.0.0.0/0 gateway=pppoe1-out routing-mark=ISP2
and another static route for all other locally-connected IP networks
e.g. dst=192.168.1.0/24 gateway=ether2-master-local routing-mark=ISP2

That should get you going.
 
Zapnologica
Long time Member
Long time Member
Topic Author
Posts: 594
Joined: Fri Sep 25, 2009 8:15 pm
Location: South frica

Re: Route IP out differente gateway

Fri Jan 15, 2016 6:39 am

Thanks,

I have implemented this. However for some reasons my sip trunks seems to be having trouble with registering.

Could I be missing something the would cause the SIP packets or protocol to not be caught by that mangle rule?
 
p3rad0x
Long time Member
Long time Member
Posts: 637
Joined: Fri Sep 18, 2015 5:42 pm
Location: South Africa
Contact:

Re: Route IP out differente gateway

Fri Jan 15, 2016 12:08 pm

Hi,

A trick you can try is to use port 5061 + if you are struggling with registrations.

If there is no nat between your pbx and and gateway router all packets originating from the PBX will be marked regardless of what type of traffic.

Alternatively, if there is nat between the PBX and Gateway Router you could change the src-addr list to a dst-addr list with the SIP providers subnet.

If I may ask what SIP provider are you using at the moment? I'm from South Africa as well and I use Telfree.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Route IP out differente gateway

Fri Jan 15, 2016 10:23 pm

Thanks,

I have implemented this. However for some reasons my sip trunks seems to be having trouble with registering.

Could I be missing something the would cause the SIP packets or protocol to not be caught by that mangle rule?
I also recommend disabling the SIP protocol helper in the firewall settings
/ip > firewall > service ports and make sure sip is disabled.

Who is online

Users browsing this forum: Aska, gigabyte091, holla29, jaclaz, johnson73, kruhek, Majestic-12 [Bot], regisc and 227 guests