Load balancing LAN has no traffic

If nat
Only one Wan works in load balancing
eth0(wan1) eth2(wan2) eth1(lan)

vyos@vyos# show interfaces
ethernet eth0 {
address dhcp
hw-id 52:54:00:37:30:e7
}
ethernet eth1 {
address 172.10.1.1/24
description lan1
hw-id 52:54:00:62:db:32
}
ethernet eth2 {
address dhcp
hw-id 52:54:00:2c:95:6f
}
loopback lo {
}

vyos@vyos:~$ ip add
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:37:30:e7 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.24/24 brd 192.168.1.255 scope global dynamic eth0
valid_lft 561310sec preferred_lft 561310sec
inet6 fe80::5054:ff:fe37:30e7/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:62:db:32 brd ff:ff:ff:ff:ff:ff
inet 172.10.1.1/24 brd 172.10.1.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe62:db32/64 scope link
valid_lft forever preferred_lft forever
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:2c:95:6f brd ff:ff:ff:ff:ff:ff
inet 192.168.1.26/24 brd 192.168.1.255 scope global dynamic eth2

interfaces {
ethernet eth0 {
address dhcp
hw-id 52:54:00:37:30:e7
}
ethernet eth1 {
address 172.10.1.1/24
description lan1
hw-id 52:54:00:62:db:32
}
ethernet eth2 {
address dhcp
hw-id 52:54:00:2c:95:6f
}
loopback lo {
}
}
load-balancing {
wan {
flush-connections
interface-health eth0 {
failure-count 1
nexthop dhcp
success-count 1
test 10 {
resp-time 5
target 114.114.114.114
ttl-limit 1
type ping
}
}
interface-health eth2 {
failure-count 1
nexthop dhcp
success-count 1
test 10 {
resp-time 5
target 114.114.114.114
ttl-limit 1
type ping
}
}
rule 1 {
inbound-interface eth1
interface eth0 {
weight 1
}
interface eth2 {
weight 1
}
protocol all
}
rule 2 {
destination {
}
exclude
inbound-interface eth1
protocol all
}
}
}
protocols {
static {
route 0.0.0.0/0 {
next-hop 192.168.1.1 {
}
}
}
}
service {
dhcp-server {
shared-network-name eth1 {
authoritative
subnet 172.10.1.0/24 {
default-router 172.10.1.1
dns-server 114.114.114.114
lease 86400
range 0 {
start 172.10.1.101
stop 172.10.1.199
}
}
}
}
ssh {
port 22
}
}
system {
config-management {
commit-revisions 100
}
console {
device ttyS0 {
speed 115200
}
}
host-name vyos
login {
user vyos {
authentication {
encrypted-password $6$vZpuCjceY$7M0AY36PKKFRz3qXCAq5dPNcT7GBcipiZQnxCg4RV3OUkcEedMyT1OgCsD2OpYq2pmI0TKvjN4l7oRcB4tb3y1
plaintext-password “”
}
}
}
name-server 8.8.8.8
name-servers-dhcp 114.114.114.114
ntp {
server 0.pool.ntp.org {
}
server 1.pool.ntp.org {
}
server 2.pool.ntp.org {
}
}
syslog {
global {
facility all {
level info
}
facility protocols {
level debug
}
}
}
}

Hello @ergao, do you have eth0 and eth2 on the same L2 network with the same GW address? I think this could be a problem.

Yes,So do we have a solution for that?

thank you for you reply .

I don’t think there is a solution for that, routing doesn’t work if you have 2 interfaces using the same subnet. For load balancing you need 2 distinct WAN interfaces.

What are you trying to accomplish in this setup? Is it possible you have 2x different WAN uplinks that are providing the same dhcp pools? Then you should be able to have one dhcp pool updated to be different, and then routing should work properly.

1 Like

I am the same telecom operator, two lines, do Wan load

It’s hard to avoid the same gateway,

Thank you very much for your reply. I still want to find a solution

Can you give us a diagram of the involved hardware and connections? If you are trying to load balance 2 connections from the same provider, then I assume modems with NAT are involved. Changing 1 modem to use a different subnet on the LAN would fix your issue.

Are both default gw’s from ISP’s the same?

Thank you very much for your reply
the two ISP gateways are the same. I deleted the default gw and LAN can access the Internet normally
Now it looks like Wan-load is normal
vyos@vyos:~$ show wan-load-balance
Interface: eth0
Status: active
Last Status Change: Mon Jan 4 10:14:03 2021
+Test: ping Target: baidu.com
Last Interface Success: 0s
Last Interface Failure: 9m2s
# Interface Failure(s): 0

Interface: eth2
Status: active
Last Status Change: Wed Dec 30 01:57:58 2020
+Test: ping Target: 192.168.1.1
Last Interface Success: 0s
Last Interface Failure: 4d12h15m37s
# Interface Failure(s): 0