I decided to created a separate topic in this, already partly covered in [Feature Request] Add GUI to use a LAN port for WAN.
First – the problem: Ethernet 2 cable is shown in UI as not connected. Configuration of it in UI still works.
Response for the get_status call found in browser dev console returns:
{
"online": true,
"up": true,
"interface": "secondwan"
},
But web socket message is different:
{
"name": "cable.status",
"data": {
"protocol": "dhcp",
"secondwan": {
"status": 3,
"mode": 0
},
"status": 1,
"mode": 0,
"ipv4": {
"gateway": "192.168.42.1",
"dns": [
"192.168.42.1",
"0.0.0.0"
],
"ip": "192.168.42.101/24"
}
}
}
I managed to get same status in the CLI:
ubus call gl-session call '{"module":"cable","func":"get_status","params":{}}'
{
"result": {
"protocol": "dhcp",
"secondwan": {
"status": 3,
"mode": 0
},
"mode": 0,
"ipv4": {
"dns": [
"192.168.42.1",
"0.0.0.0"
],
"gateway": "192.168.42.1",
"ip": "192.168.42.101/24"
},
"status": 1
}
}
Status 3 seem to be a disconnected state.
I ended up with discovering /usr/lib/oui-httpd/rpc/cable but it’s bite code. It seems to check /proc/gl-hw-info/secondwan that doesn’t exist. At this point I’m stuck.
What I’ve done so far:
- Adjusted my router setup in /usr/share/gl-eth-ports.json:
"axt1800": {
"wan": { "port": "eth0", "silk": "WAN" },
"secondwan": { "name": "lan2", "port": "eth1", "silk": "WAN/LAN2" },
"lan": [
{ "name": "lan1", "port": "eth2", "silk": "LAN1" }
]
},
2. Adjusted /etc/config/board_special:
config service 'hardware'
option secondwan 'eth1'
config switch 'switch'
option enable '0'
config network 'network'
option wan 'eth0'
option lan 'eth1 eth2'
3. Rebooted router, switched LAN2 to WAN mode in ui.
4. Adjusted firewall adding secondwan and secondwan6 to wan rules in luci, could be done with uci commands
5. Added missing options to secondwan in /etc/config/network
option force_link '0'
option ipv6 '0'
option classlessroute '0'
option metric '50'
6. Added to kmwan /etc/config/kmwan:
config member 'secondwan'
option interface 'secondwan'
option metric '50'
option weight '1'
option track_mode 'force'
option addr_type '4'
option disabled '0'
option check '1'
list tracks 'ping,1.1.1.1'
list tracks 'ping,8.8.8.8'
list tracks 'ping,208.67.222.222'
list tracks 'ping,208.67.220.220'
Probably the only missing part is secondwan6 but it’s not related to the cable connection status.
