Forum Turris
Fórum Turris Nápověda

Milí majitelé routerů Turris,

toto fórum bylo 9. 12. 2016 zmrazeno a nahrazeno naším novým Turris fórem. Ještě chvíli bude dostupné k prohlížení, ale již zde není možné přispívat. Více informací naleznete v oznámení o uzavření fóra.


Dear Turris routers users,

this forum has been frozen on Dec 9th, 2016 and replaced by our new Turris forum. It will be read-only accessible for some time after. For more information, read the announcement about closing the forum.

Nahoru Téma Majitelé routerů / Technická podpora / MultiWAN assistance?
- - Od redpola Dne 2015-11-09 17:49
Has anyone successfully set up a multiwan using Turris? I am trying and cannot get it to work. I can get both WAN interfaces to connect to the internet but multiwan simply will not work for me. Apologies for english - my Czech is poor.

root@gate:/etc/config# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         2.127.238.180   0.0.0.0         UG    0      0        0 pppoe-wan2
2.127.238.180   0.0.0.0         255.255.255.255 UH    0      0        0 pppoe-wan2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan
195.166.130.138 0.0.0.0         255.255.255.255 UH    0      0        0 pppoe-wan1
root@gate:/etc/config# cat network

config interface 'loopback'
  option ifname 'lo'
  option proto 'static'
  option ipaddr '127.0.0.1'
  option netmask '255.0.0.0'

config globals 'globals'
  option ula_prefix 'fdd1:f1e1:54dc::/48'

config interface 'lan'
  option force_link '1'
  option type 'bridge'
  option proto 'static'
  option ipaddr '192.168.1.1'
  option netmask '255.255.255.0'
  option ip6assign '60'
  option dns '192.168.1.100'
  option _orig_ifname 'eth0 eth1 wlan0 wlan0-1'
  option _orig_bridge 'true'
  option ifname 'eth1'

config switch
  option name 'switch0'
  option reset '1'
  option enable_vlan '1'

config switch_vlan
  option device 'switch0'
  option vlan '1'
  option ports '0 1 2 3 4 '

config switch_vlan
  option device 'switch0'
  option vlan '2'
  option ports '5 6'

config interface 'wan1'
  option proto 'pppoe'
  option ifname 'eth2'
  option username 'user1'
  option password 'pass1'
  option keepalive '5 5'

config interface 'wan2'
  option proto 'pppoe'
  option username 'user2'
  option password 'pass2'
  option _orig_ifname 'eth0.2'
  option _orig_bridge 'false'
  option ifname 'eth0'

root@gate:/etc/config# cat multiwan

config multiwan 'config'
  option default_route 'balancer'
  option enabled '1'

config interface 'wan1'
  option weight '10'
  option health_interval '10'
  option icmp_hosts 'dns'
  option timeout '3'
  option health_fail_retries '3'
  option health_recovery_retries '5'
  option failover_to 'balancer'
  option dns 'auto'

config interface 'wan2'
  option weight '10'
  option health_interval '10'
  option icmp_hosts 'dns'
  option timeout '3'
  option health_fail_retries '3'
  option health_recovery_retries '5'
  option failover_to 'balancer'
  option dns 'auto'


Am I missing something obvious?
Nadřazený - - Od milanroubal (>) Dne 2015-11-11 16:18
Yes, I have multiwan running. It took me some time, it does not work out of the box. To analyze the status don't use route command, it will not tell truth. Use this 3 commands:
ip show route table 170
ip show route table 171
ip show route table 172
also show
ip show addr 
and
iptables -L -n -t MANGLE

I just wrote the commands from the head, but this should show the basic info to analyze your status.
Nadřazený - - Od redpola Dne 2015-11-11 22:42
Thanks for the assistance. I stupidly expected it to work out of the box, using this guide.

I guess I need to figure out linux networking and iptables. Thanks! :)
Nadřazený - Od milanroubal (>) Dne 2015-11-11 23:18
so the correct commands are:
ip route show table 170
ip route show table 171
ip route show table 172

ip addr show 

iptables -L -n -t mangle

I think the problem is, that your
route -n
command does not show 2 gateways. Try to add in file /etc/config/network
option gateway 'xxx.xxx.xxx.xxx'
to both WAN interfaces.

As I have special setup, I have even 3 gateways :)
root@turris:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.100.0.1      0.0.0.0         UG    0      0        0 tap0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth2
10.0.0.0        192.168.1.10    255.255.0.0     UG    0      0        0 br-lan
10.100.0.0      0.0.0.0         255.255.255.0   U     0      0        0 tap0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

ip route show should show 2 defaults for you

root@turris:~# ip route show
default via 10.100.0.1 dev tap0
default via 192.168.0.1 dev eth2
10.0.0.0/16 via 192.168.1.10 dev br-lan  proto static
10.100.0.0/24 dev tap0  proto kernel  scope link  src 10.100.0.2
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.12
192.168.1.0/24 dev br-lan  proto kernel  scope link  src 192.168.1.1

and than what is visible in each route table:
root@turris:~# ip route show table 170
10.0.0.0/16 via 192.168.1.10 dev br-lan  proto static
10.100.0.0/24 dev tap0  proto kernel  scope link  src 10.100.0.2
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.12
192.168.1.0/24 dev br-lan  proto kernel  scope link  src 192.168.1.1
root@turris:~# ip route show table 171
default via 192.168.0.1 dev eth2  proto static  src 192.168.0.12
10.0.0.0/16 via 192.168.1.10 dev br-lan  proto static
10.100.0.0/24 dev tap0  proto kernel  scope link  src 10.100.0.2
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.12
192.168.1.0/24 dev br-lan  proto kernel  scope link  src 192.168.1.1
root@turris:~# ip route show table 172
default via 10.100.0.1 dev tap0  proto static  src 10.100.0.2
10.0.0.0/16 via 192.168.1.10 dev br-lan  proto static
10.100.0.0/24 dev tap0  proto kernel  scope link  src 10.100.0.2
192.168.0.0/24 dev eth2  proto kernel  scope link  src 192.168.0.12
192.168.1.0/24 dev br-lan  proto kernel  scope link  src 192.168.1.1
Nadřazený - Od milanroubal (>) Dne 2015-11-11 23:27 Hlasů 1
I am trying to remember what changes I needed to do to make it working. When I look on files I can see I have modified all including /usr/bin/multiwan, but I am not sure what all changes I needed to have it running and to survive updates.
Nadřazený - - Od milanroubal (>) Dne 2015-11-11 23:32
so some search to history show the description of the problem

I know that there was some modification needed to avoid this collision, I am continuing searching
Nadřazený - Od redpola Dne 2015-11-17 18:37
Thank you very much for your help. I finally got it to work today.

The answer was in your previous linked post. All it took was:

root@gate:/etc/config# iptables -t mangle --delete MultiWanRules 1
root@gate:/etc/config# /etc/init.d/multiwan restart
root@gate:/etc/config# /usr/bin/multiwan: line 1018: config_clear: not found

root@gate:/etc/config# ip route show table LoadBalancer
default  proto static
  nexthop via 195.166.130.178  dev pppoe-wan1 weight 10
  nexthop via 2.127.238.180  dev pppoe-wan2 weight 10
2.127.238.180 dev pppoe-wan2  proto kernel  scope link  src 2.121.127.82
192.168.1.0/24 dev br-lan  proto kernel  scope link  src 192.168.1.1
195.166.130.178 dev pppoe-wan1  proto kernel  scope link  src 80.189.166.198


And now traffic is flowing as I expected over both gateways.

When the IP addresses change (these are dynamically-assigned) then I guess it will break and I will fix it again.

Thank you very very much. I owe you a beer or ten. :)
Nadřazený - Od milanroubal (>) Dne 2015-11-11 23:50 Hlasů 1
just came to my mind you should also verify content of
/etc/iproute2/rt_tables
that you have there
170 LoadBalancer
171 MWAN1
172 MWAN2
Nahoru Téma Majitelé routerů / Technická podpora / MultiWAN assistance?

Powered by mwForum 2.29.3 © 1999-2013 Markus Wichitill