Redirect http traffic to other ether interface
RouterOS general discussion

NeODarK2
just joined
Posts: 7
Joined: Sat Feb 16, 2008 7:56 pm
Reputation: 0

Redirect http traffic to other ether interface

by NeODarK2 » Sat Feb 16, 2008 8:02 pm

Hi, I have three interfaces, one is my LAN (ether3) and the others interfaces are ether1 and ether2 I have two connections to internet, and I want to make ether1 primary, for all traffic, and I want to mark http packets (port 80) and send it to the ether2, my idea is that if I put the emule, I can see web pages without lag. Some person can help me??? thanks.

User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 7397
Joined: Mon Jun 19, 2006 11:15 pm
Reputation: 25
First RouterOS version: 2.8
Location: Home Network Ltd., Minsk, Belarus

Re: Redirect http traffic to other ether interface

by Chupaka » Sun Feb 17, 2008 1:58 am

mangle - prerouting - port 80 - mark-routing = 'new_route'
route - add - 0.0.0.0/0, gw = <your ether2 gateway>, mark = 'new_route'
Russian-speaking forum: http://forum.mikrotik.by. Welcome :)

For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

NeODarK2
just joined
Posts: 7
Joined: Sat Feb 16, 2008 7:56 pm
Reputation: 0

Re: Redirect http traffic to other ether interface

by NeODarK2 » Sun Feb 17, 2008 11:35 am

thanks for your reply my friend, but I make by this form, and only work a few minutes, later, I can´t see web pages, who´s the problem?

User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 7397
Joined: Mon Jun 19, 2006 11:15 pm
Reputation: 25
First RouterOS version: 2.8
Location: Home Network Ltd., Minsk, Belarus

Re: Redirect http traffic to other ether interface

by Chupaka » Sun Feb 17, 2008 6:37 pm

hmmm... post your firewall and routes config here
Russian-speaking forum: http://forum.mikrotik.by. Welcome :)

For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

miahac
Long time Member
Long time Member
Posts: 513
Joined: Wed Dec 14, 2005 6:04 pm
Reputation: 0
Location: Wichita, KS

Re: Redirect http traffic to other ether interface

by miahac » Sun Feb 17, 2008 9:22 pm

sorry to hijack thread but I am perusing a similar goal maybe we can work together to solve both problems. I have RB 333 with wireless AP on WLAN1 and WLAN2 and Ether1. WLAN3 is public IP wireless bridge to a location T1 line. Clients connect with PPPoE and are assigned a public IP from the T1 IP range. Ether3 goes to a cable modem.

I am trying to dump http traffic to the cable modem. I have tried a simple policy route, http://wiki.mikrotik.com/wiki/Policy_Routing_in_RouterOS_2.9.x but I think it does not work properly because the customers are not natted. I am wondering if the following is best?

Code: Select all

/ip firewall mangle add chain=prerouting protocol=tcp dst-port=8080 action=mark-routing new-routing-mark=HTTP
passthrough=yes comment="" disabled=no

/ip route add gateway=x.x.x.x routing-mark=HTTP comment="HTTP Traffic" disabled=no
/ip route rule add src-address=0.0.0.0/0 table=HTTP action=lookup

/ip proxy
enabled: yes
src-address: 0.0.0.0
port: 8080
parent-proxy: 0.0.0.0:0
cache-drive: system
cache-administrator: "webmaster"
max-disk-cache-size: none
max-ram-cache-size: none
cache-only-on-disk: no
maximal-client-connections: 1000
maximal-server-connections: 1000
max-object-size: 512KiB
max-fresh-time: 3d

/ip firewall nat
chain=dstnat protocol=tcp dst-port=80 action=redirect to-ports=8080

/ip firewall filter
chain=input in-interface=ether3 src-address=0.0.0.0/0 protocol=tcp dst-port=8080 action=drop


edit -- One more thing. I do not care if http traffic reverses to public IP's the publics are for things like vpn, voip etc.
Network Administrator
Kansas Hosting and Wichita Data Centers

miahac
Long time Member
Long time Member
Posts: 513
Joined: Wed Dec 14, 2005 6:04 pm
Reputation: 0
Location: Wichita, KS

Re: Redirect http traffic to other ether interface

by miahac » Sun Feb 17, 2008 9:48 pm

will adding a dstnat have any effect? like ..

Code: Select all

/ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 action=mark-routing new-routing-mark=HTTP
passthrough=yes comment="" disabled=no

/ip firewall nat
chain=dstnat protocol=tcp dst-port=80 action=passthrough

/ip route add gateway=x.x.x.x routing-mark=HTTP comment="HTTP Traffic" disabled=no
/ip route rule add src-address=0.0.0.0/0 table=HTTP action=lookup
Network Administrator

Kansas Hosting and Wichita Data Centers

User avatar
macgaiver
Forum Guru
Forum Guru
Posts: 1429
Joined: Wed May 18, 2005 5:57 pm
Reputation: 49
First RouterOS version: v2.8.14
Location: Sol III, Sol system, Sector 001, Alpha Quadrant

Re: Redirect http traffic to other ether interface

by macgaiver » Mon Feb 18, 2008 11:10 am

I suggest to route DNS requests also trough that interface
I know what i don't know, do you?

NeODarK2
just joined
Posts: 7
Joined: Sat Feb 16, 2008 7:56 pm
Reputation: 0

Re: Redirect http traffic to other ether interface

by NeODarK2 » Tue Feb 19, 2008 1:23 pm

Thanks Chupaka now it´s work well, thanks again my friend

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 8 guests

It is currently Mon May 02, 2016 6:37 am