Community discussions

 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Dual Wan config on my router

Tue Oct 08, 2019 1:24 pm

Hi,

is it possible to run (input) dual wan on same router (out 1 LAN) ???
In my scenario, i have 1 static wan connection and 2nd wan is PPpoe.
Static WAN 1 = 10.1.1.1
PPpoe WAN 2 = 192.168.15.1
static wan is already working in my work place and want to add 2nd wan PPpoe connection in my WAN side,
both WAN will use or work on my single LAN.
LAN IP 192.168.1.1
now i want to set LAN ip for my both wans, like
192.168.1.10 for wan1 and 192.168.1.20 for wan2
ip will be same and if i want to switch the internet, i just change the gateway of my pc or client and internet keeps work smoothly ,,,,

is it possible or not??
if it is possible then please help me!!!!!
 
User avatar
Anumrak
Forum Guru
Forum Guru
Posts: 1033
Joined: Fri Jul 28, 2017 2:53 pm

Re: Dual Wan config on my router

Tue Oct 08, 2019 3:20 pm

Hey. Why you want 2 LAN IPs for your WANs? Just use your single LAN for both WAN with different route distance, and create address list, for example "WAN", to add both interfaces there and use source NAT with masquerade action for your LAN. That's it.
 
Sob
Forum Guru
Forum Guru
Posts: 4669
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dual Wan config on my router

Tue Oct 08, 2019 9:39 pm

There could be some reason why WAN should be selectable by device in LAN simply by using different gateways.

And yes, it's possible: Switching WANs by Host Gateway Selection
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Wed Oct 09, 2019 8:25 am

Hey. Why you want 2 LAN IPs for your WANs? Just use your single LAN for both WAN with different route distance, and create address list, for example "WAN", to add both interfaces there and use source NAT with masquerade action for your LAN. That's it.

Anumrak you said well, exactly really i want to do what you are saying, but i have no idea how to do it?? i have tried many thing but 2nd wan is not working in my scenario ,,,
i do not want to set failover, i want to use both wans internet, i want to set 10 users in wan 1 and wanna set 20 users on wan 2 and they can communicate with each other, all users remain in same (single LAN) network, just change the gateway manually 10 to 20 or shift on wan 2,

2 wans work in my single LAN,,,,,
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 9:52 am

no one is answering my question :( :( :(

Please Help!!!!!!!!!
 
dmitris
newbie
Posts: 42
Joined: Mon Oct 09, 2017 1:08 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 10:01 am

Can you make a network diagram? Maybe than we'll understand better what you want to achieve.
Last edited by dmitris on Fri Oct 11, 2019 11:26 am, edited 1 time in total.
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 10:26 am

i have attached a pic of my desire scenario...
please help, WAN-01 is already running in my network i want to add PPpoe internet,

please help
You do not have the required permissions to view the files attached to this post.
 
dmitris
newbie
Posts: 42
Joined: Mon Oct 09, 2017 1:08 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 11:07 am

Now i see, the simplest way to do that is divide 1 x /24 to 2 x /25
it will give you two separate subnet spaces:
IP-s: 192.168.1.2 - 192.168.1.126
MASK 255.255.255.128
GW LAN1 == 192.168.1.1/25

IP-s: 192.168.1.130 - 192.168.1.254
MASK 255.255.255.128
GW LAN2 == 192.168.1.129/25

When subnets is made, you can simply add src-nat for each subnet..
Subnet1:
/ip firewall nat 
add chain=srcnat src-address=192.168.1.0/25 out-interface=WAN1 action=masquerade

Subnet2:
/ip firewall nat 
add chain=srcnat src-address=192.168.1.128/25 out-interface=WAN2 action=masquerade
 
mkx
Forum Guru
Forum Guru
Posts: 2948
Joined: Thu Mar 03, 2016 10:23 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 11:34 am

When subnets is made, you can simply add src-nat for each subnet..

Is it really this simple? My impression is that dst-nat is done after routing decision is made (which actually selects the out-interface). Which means that src-address property in NAT rules example doesn't help. Instead it would be necessary to establish two routing tables (with default route via each WAN, distinguished by using different routing marks) and mangle rules that will mark packets originating from each of LAN subnets with corresponding routing marks ...

And note that mangling and fasttracking are exclusive, so one has to disable the fasttracking firewall filter rule to make mangling work. This in turn reduces routing performance of router and could happen that routing capacity actually drops below WAN line(s) capacity.
BR,
Metod
 
dmitris
newbie
Posts: 42
Joined: Mon Oct 09, 2017 1:08 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 11:59 am

in contradictory i want to say that DST-NAT in PREROUTING chain and it is done before routing decision, not after as you said, check packet flow diagram....
 
dmitris
newbie
Posts: 42
Joined: Mon Oct 09, 2017 1:08 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 1:34 pm

When subnets is made, you can simply add src-nat for each subnet..

Is it really this simple? My impression is that dst-nat is done after routing decision is made (which actually selects the out-interface). Which means that src-address property in NAT rules example doesn't help. Instead it would be necessary to establish two routing tables (with default route via each WAN, distinguished by using different routing marks) and mangle rules that will mark packets originating from each of LAN subnets with corresponding routing marks ...

And note that mangling and fasttracking are exclusive, so one has to disable the fasttracking firewall filter rule to make mangling work. This in turn reduces routing performance of router and could happen that routing capacity actually drops below WAN line(s) capacity.
You were right.....The second default route will be inactive within the same routing table.
 
mkx
Forum Guru
Forum Guru
Posts: 2948
Joined: Thu Mar 03, 2016 10:23 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 2:29 pm

in contradictory i want to say that DST-NAT in PREROUTING chain and it is done before routing decision, not after as you said, check packet flow diagram....

DST-NAT is indeed in prerouting. However, the NAT rules are about SRC-NAT and that's done in postrouting which comes after routing decision. See routing diagram.
BR,
Metod
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 2:30 pm

first of all many many thanks to all of you for concerning ,,,,

actually one reason behind this both wans into single LAN, both networks will communicate with each other, as i know about subnetting, FIRST SUBNET IS UNKNOWN FOR OTHER SUBNET, that's why i want to deploy both WANs into my LAN,

let me clear this, 192.168.1.1 gateway is for executive persons, they are using ERP software which is connected with server, that's why i want to set this gateway for my executive officers, and 192.168.1.2 for other users.
both will work in same LAN and they can share each other any thing very simply,

now please tell me what to do??
 
mkx
Forum Guru
Forum Guru
Posts: 2948
Joined: Thu Mar 03, 2016 10:23 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 2:42 pm

I guess this thread is about similar issue ...
BR,
Metod
 
dmitris
newbie
Posts: 42
Joined: Mon Oct 09, 2017 1:08 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 2:45 pm

in contradictory i want to say that DST-NAT in PREROUTING chain and it is done before routing decision, not after as you said, check packet flow diagram....

DST-NAT is indeed in prerouting. However, the NAT rules are about SRC-NAT and that's done in postrouting which comes after routing decision. See routing diagram.
You are right...
 
Sob
Forum Guru
Forum Guru
Posts: 4669
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dual Wan config on my router

Fri Oct 11, 2019 2:55 pm

Just reminding, there's also this post in this very thread, linking to another thread which describes exactly what you say you want to have.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Mon Oct 14, 2019 8:18 am

Just reminding, there's also this post in this very thread, linking to another thread which describes exactly what you say you want to have.

what does this mean??
 
Sob
Forum Guru
Forum Guru
Posts: 4669
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dual Wan config on my router

Mon Oct 14, 2019 6:37 pm

It means that I already posted a link to what should be the answer you're looking for, but for some reason you seemed to miss it.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
mshahid85
just joined
Topic Author
Posts: 24
Joined: Thu Mar 01, 2018 12:19 pm

Re: Dual Wan config on my router

Tue Oct 15, 2019 8:06 am

It means that I already posted a link to what should be the answer you're looking for, but for some reason you seemed to miss it.
Oh! ok,
let me check, and really sorry for that , how could do this, sorry let me check please,,,
and thanks for your reply,

Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests