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
}
}
}
}