Skip to content

UniFi

Need ssh connection to UniFi USG router

configure
set interfaces pseudo-ethernet peth0 link eth0
set interfaces pseudo-ethernet peth0 address 192.168.100.100/24
set interfaces pseudo-ethernet peth0 description "Access to modem"
set service nat rule 5001 type masquerade
set service nat rule 5001 destination address 192.168.100.1
set service nat rule 5001 outbound-interface peth0
commit;save;exit

To make the change permanent, edit the config.gateway.json file:

{
"interfaces": {
"pseudo-ethernet": {
"peth0": {
"address": ["192.168.100.100/24"],
"description": "Access to modem",
"link": ["eth0"]
}
}
},
"service": {
"nat": {
"rule": {
"5001": {
"destination": {
"address": ["192.168.100.1"]
},
"outbound-interface": ["peth0"],
"type": "masquerade"
}
}
}
}
}

Reference: