PeeS
PeeS

Reputation: 1164

Unifi USG - Route one device through WAN2 and port forward

On my newly installed Unifi USG (Unifi Security Gateway/Controller) at home i have two static IP Internets connected to :

WAN1 (ETH0) : xxx.xxx.xxx.xxx

WAN2 (ETH2) : yyy.yyy.yyy.yyy

Whole home network is routed by default via WAN1, with WAN2 set as 'failover' by default in USG.

I need to:

Here is the CLI dump i have in USG:

UNIROUTER:~$ ip route
default via xxx.xxx.xxx.xxx dev eth0  proto zebra 
xxx.xxx.xxx.xxx/24 dev eth0  proto kernel  scope link  src xxx.xxx.xxx.xxx
127.0.0.0/8 dev lo  proto kernel  scope link  src 127.0.0.1 
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.1 
yyy.yyy.yyy.yyy dev eth2  proto kernel  scope link  src yyy.yyy.yyy.yyy



Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface    IP Address                        S/L  Description                 
---------    ----------                        ---  -----------                 
eth0         xxx.xxx.xxx.xxx/24                u/u  WAN                         
eth1         192.168.1.1/24                    u/u  LAN                         
eth2         yyy.yyy.yyy.yyy/24                u/u  WAN2                        
lo           127.0.0.1/8                       u/u                              
             ::1/128                          

I have no idea how to set it up, and have already found i can't do it via web.. Can you help me out, to set it up please?

Thank you in advance.

Upvotes: 0

Views: 4453

Answers (1)

PeeS
PeeS

Reputation: 1164

Ok, minutes after - i found the solution, lucky me ;-)

#ROUTING
configure
set protocols static table 5 route 0.0.0.0/0 next-hop yyy.yyy.yyy.yyy
set firewall modify LOAD_BALANCE rule 2640 action modify
set firewall modify LOAD_BALANCE rule 2640 modify table 5
set firewall modify LOAD_BALANCE rule 2640 source address 192.168.1.119
set firewall modify LOAD_BALANCE rule 2640 protocol all
commit;exit



#PORTFWD
configure
set service nat rule 4000 description "COTX"
set service nat rule 4000 destination address yyy.yyy.yyy.yyy
set service nat rule 4000 destination port 22
set service nat rule 4000 inbound-interface eth2
set service nat rule 4000 inside-address address 192.168.1.119
set service nat rule 4000 inside-address port 22
set service nat rule 4000 protocol tcp
set service nat rule 4000 type destination
commit;exit

Upvotes: 0

Related Questions