Community discussions

MikroTik App
 
yaikun94
Member Candidate
Member Candidate
Topic Author
Posts: 110
Joined: Tue Nov 24, 2015 10:05 am

Load Balancing force static ip using specific wan

Tue May 24, 2016 8:00 am

I have RB1100 that using 2 wan. I already configured load balancing pcc.
Ip local: 192.168.1.0/24
here is my config.
/ip firewall mangle
chain=input action=mark-connection new-connection-mark=wan1_conn passthrough=yes in-interface=wan1 
chain=input action=mark-connection new-connection-mark=wan2_conn passthrough=yes in-interface=wan2 

chain=output action=mark-routing new-routing-mark=to_wan1 passthrough=yes connection-mark=wan1_conn 
chain=output action=mark-routing new-routing-mark=to_wan2 passthrough=yes connection-mark=wan2_conn 

chain=prerouting action=accept dst-address=x.x.x.13/24 in-interface=bridge-local 
chain=prerouting action=accept dst-address=y.y.y.10/24 in-interface=bridge-local 

chain=prerouting action=mark-connection new-connection-mark=wan1_conn passthrough=yes dst-address-type=!local in-interface=bridge-local per-connection-classifier=both-addresses-and-ports:2/0 
chain=prerouting action=mark-connection new-connection-mark=wan2_conn passthrough=yes dst-address-type=!local in-interface=bridge-local per-connection-classifier=both-addresses-and-ports:2/1

chain=prerouting action=mark-routing new-routing-mark=to_wan1 passthrough=yes in-interface=bridge-local connection-mark=wan1_conn 
chain=prerouting action=mark-routing new-routing-mark=to_wan2 passthrough=yes in-interface=bridge-local connection-mark=wan2_conn

/ip route
add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=x.x.x.1 routing-mark=to_wan1 scope=30 target-scope=10
add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=y.y.y.1 routing-mark=to_wan2 scope=30 target-scope=10

add check-gateway=ping distance=1 dst-address=0.0.0.0/0 gateway=x.x.x.1 scope=30 target-scope=10
add check-gateway=ping distance=2 dst-address=0.0.0.0/0 gateway=y.y.y.1 scope=30 target-scope=10
i want ip 192.168.1.180 using only wan1.
I already tried to add these rules but my friend say they still see me sending packets with 2 ip wan
/ip firewall mangle
add chain=prerouting src-address=192.168.1.180 action=mark-routing new-routing-mark=to_wan1
/ip route
add dst-address=0.0.0.0/0 routing-mark=to_wan1 gateway=x.x.x.1
 
yaikun94
Member Candidate
Member Candidate
Topic Author
Posts: 110
Joined: Tue Nov 24, 2015 10:05 am

Re: Load Balancing force static ip using specific wan

Tue May 24, 2016 12:00 pm

solved.
using ip firewall filter, i accept all traffic from wan1 and drop wan2.
here is the rules
/ip firewall filter
add action=accept chain=forward dst-address=[IP WAN1] src-address=\
    192.168.1.180
add action=drop chain=forward dst-address=[IP WAN2] src-address=\
    192.168.1.180
 
praetorianwls
just joined
Posts: 8
Joined: Sun Nov 27, 2016 9:42 pm

Re: Load Balancing force static ip using specific wan

Fri Dec 13, 2019 9:31 pm

hello
I have RB750gr3 with 2 WAN connections +LAN bridge ports 2/3/4

/ip firewall filter print
chain=forward action=accept src-address=192.168.100.107 out-interface=ether5-TELEKOM log=no log-prefix=""
chain=forward action=drop src-address=192.168.100.107 out-interface=RDS pppoe log=no log-prefix=""
/ip firewall mangle print
chain=prerouting action=mark-routing new-routing-mark=VIATELEKOM passthrough=yes src-address=192.168.100.107 log=no log-prefix=""

route rule with routing mark
https://ibb.co/Vgs5v1g

Internet works via 192.168.100.107 but is dialup slow
What can I do?