Community discussions

MikroTik App
 
nelson6069
Member Candidate
Member Candidate
Topic Author
Posts: 203
Joined: Mon Oct 15, 2012 5:56 pm

2 WAN port load balancing.. HELP..

Sat Oct 27, 2012 10:16 pm

Why i put in this code, still cannot run?

i am using RB450G, and i had reset the device...so it totally don't have any setting on it..

add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local <== is this Eth1 port for local?
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1 <== is this Eth2 port for my WAN 1?
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2 <== is this Eth3 port for my WAN 2?

and do i need to setup dhcp for my Eth1 which is local?

=======================================================================================

/ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2

/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn

add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2

add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local

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

add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping

/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade
 
nelson6069
Member Candidate
Member Candidate
Topic Author
Posts: 203
Joined: Mon Oct 15, 2012 5:56 pm

Re: 2 WAN port load balancing.. HELP..

Mon Oct 29, 2012 2:26 pm

Why i put in this code, still cannot run?

i am using RB450G, and i had reset the device...so it totally don't have any setting on it..

add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local <== is this Eth1 port for local?
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1 <== is this Eth2 port for my WAN 1?
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2 <== is this Eth3 port for my WAN 2?

and do i need to setup dhcp for my Eth1 which is local?

=======================================================================================

/ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2

/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn

add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2

add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=Local
add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=Local

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

add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_WAN2 check-gateway=ping

add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping

/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade

anyone know?
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: 2 WAN port load balancing.. HELP..

Mon Oct 29, 2012 11:39 pm

You don't specify what your question or problem that you are running into is. So without that information, no one can help.
 
nelson6069
Member Candidate
Member Candidate
Topic Author
Posts: 203
Joined: Mon Oct 15, 2012 5:56 pm

Re: 2 WAN port load balancing.. HELP..

Tue Oct 30, 2012 5:07 pm

You don't specify what your question or problem that you are running into is. So without that information, no one can help.
Why i put in this code, still cannot run?

i am using RB450G, and i had reset the device...so it totally don't have any setting on it..

add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local <== is this Eth1 port for local?
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=WAN1 <== is this Eth2 port for my WAN 1?
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=WAN2 <== is this Eth3 port for my WAN 2?

and do i need to setup dhcp for my Eth1 which is local?
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: 2 WAN port load balancing.. HELP..

Tue Oct 30, 2012 5:22 pm

Do you have an interface that is named Local, WAN1, and WAN2? If not then that is a problem. You also don't need to specify the broadcast IP and Network IP manually, that will be calculated by the router internally by specifying the /24 after the IP. By placing them in a console session it should highlight any syntax errors that you are running into for your particular version.
 
nelson6069
Member Candidate
Member Candidate
Topic Author
Posts: 203
Joined: Mon Oct 15, 2012 5:56 pm

Re: 2 WAN port load balancing.. HELP..

Tue Oct 30, 2012 6:57 pm

Do you have an interface that is named Local, WAN1, and WAN2? If not then that is a problem. You also don't need to specify the broadcast IP and Network IP manually, that will be calculated by the router internally by specifying the /24 after the IP. By placing them in a console session it should highlight any syntax errors that you are running into for your particular version.
ya.. i have the interface named Local, WAN1 and WAN2, but it seems like not working :(
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: 2 WAN port load balancing.. HELP..

Tue Oct 30, 2012 7:11 pm

Have you tried removing the broadcast and network parts of the command? Have you tried pasting the commands directly to a console or SSH session to see what the syntax errors might be?

Who is online

Users browsing this forum: ppptran and 67 guests