Community discussions

MikroTik App
 
radomir
just joined
Topic Author
Posts: 2
Joined: Wed Sep 26, 2007 2:04 pm

peer to peer prerouting

Wed Sep 26, 2007 2:31 pm

Hi, I have 2 ISPs and I want to use ISP1 for http connections and ISP2 for ftp+p2p (lots of clients with emule,bit-torrent)
Since for different routing I need routing-mark I tried everything - mark connections, mark packets, mark routing but still can’t reroute my p2p connections to go via ISP2. Any ideas?

p.s. first route is Destination=0.0.0.0/0 Gateway=ISP2 with routing-mark=all-p2p (marked already with mark-packets)
Second route is Destination=0.0.0.0/0 Gateway=ISP1
 
User avatar
tgrand
Long time Member
Long time Member
Posts: 667
Joined: Mon Aug 21, 2006 2:57 am
Location: Winnipeg, Manitoba, Canada

Re: peer to peer prerouting

Wed Sep 26, 2007 3:03 pm

Set the gateway you wish to use for P2P as the default route.
Set routing mark for TCP traffic on port 80 to send it to the other gateway.
 
radomir
just joined
Topic Author
Posts: 2
Joined: Wed Sep 26, 2007 2:04 pm

Re: peer to peer prerouting

Wed Sep 26, 2007 3:38 pm

well i do that but every route that i add with some routing-mark - not working - dunno why!?!?
 
User avatar
sariao
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Thu Jul 08, 2004 10:55 am
Location: Saudi Arabia

Re: peer to peer prerouting

Wed Sep 26, 2007 4:35 pm

Here you are, next time try to post your ip configurations:

Adjust the values between "[]" :
/ip fire man
add chain=prerouting action=jump jump=markhttp in-interface=[YOUR LOCAL INTERFACE] dst-port=80 protocol=tcp passthrough=no
add chain=prerouting action=jump jump=markhttp in-interface=[YOUR LOCAL INTERFACE] dst-port=443 protocol=tcp passthrough=no
add chain=markhttp action=mark-connection new-connection-mark=http passthrough=yes
add chain=markhttp action=mark-routing new-routing-mark=http passthrough=no 
add action=return

/ip firewall nat 
add chain=src-nat action=src-nat to-address=[your ISP1 src Address] connection-mark=http comm="HTTP NAT"
add chain=src-nat action=masquerade comm="All Traffic"

/ip route
add dst-address=0.0.0.0/0 gateway=[YOUR ISP1 GATEWAY] routing-mark=http
add dst-address=0.0.0.0/0 gateway=[YOUR ISP2 GATEWAY]
regards.
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Re: peer to peer prerouting

Thu Sep 27, 2007 5:49 pm

Thank the above idea.

I really want to known whether the rules can work well?
 
JR
Member Candidate
Member Candidate
Posts: 120
Joined: Tue Nov 08, 2005 3:27 am

Re: peer to peer prerouting

Thu Sep 27, 2007 7:28 pm

.... there's only one way to find out :lol:

Who is online

Users browsing this forum: Bing [Bot], GoogleOther [Bot], InfraErik, ivankrosl and 125 guests