Dashboard DNS labeled as Gateway

My NethServer 6.6 acting as gateway shows the following status on the Dashboard page:

It seems like the DNS addresses are displayed on the wrong line.

Could you reproduce it?

On my Nethserver 6.6 the gateway value is empty.
It’s a Server&Gateway configuration.

@davidep @filippo_carletti

Thanks @nas for diving into the code!

The line you changed searched for gateway value on green interfaces only.

  • As we can see, it does not work on systems with red.
  • I think changing green to red should not work on systems without red.

Could we just print the output of (?)

ip route | grep ^default

default via XXX.XXX.XXX.XXX dev ethY

or search in bose Green and RED but it wouldnt show PPPoe so better use
ip route | grep ^default | awk ‘{print $3}’

awk :astonished: ??

ok ok ok, that was just an idea.

If we’ll implement it, let’s parse ip route output with PHP :blush:

Have Implemented :slight_smile:

1 Like

Great @nas, your PR on GitHub make me feel Redmine is redundant :wink:

You forgot a case: multiwan in balance mode.
In that configuration, the default gateway is empty.
I think that the idea is to show the configured gateway, so:
if red is not present show green def gw
if red is present show gw for every red

Maybe @giacomo has a better idea.

http://dev.nethserver.org/users/365

@filippo_carletti why in multiwan default gw is empty ?
it should be like :
default via 172.31.229.116 dev pppoe-wan_2 proto static metric 30
default via 193.34.92.254 dev pppoe-wan proto static metric 40

Because shorewall uses a table named balance.
You’d see your two default lines with:

ip ro sh ta balance

I could not implement 2 GW so show output pls
and
ip ro sh

[root@mail ~]# ip route | grep ^default | awk '{print $3}'
[root@mail ~]#

could you show pls
ip ro sh

[root@mail ~]# ip ro
192.168.71.1 dev eth2  scope link  src 192.168.71.244 
192.168.36.2 dev tun2  proto kernel  scope link  src 192.168.36.1 
192.168.3.2 dev tun3  proto kernel  scope link  src 192.168.3.1 
208.67.222.222 via 192.168.71.1 dev eth2 
192.168.4.1 dev tun0  proto kernel  scope link  src 192.168.4.2 
192.168.2.2 dev tun4  proto kernel  scope link  src 192.168.2.1 
192.168.35.2 dev tun1  proto kernel  scope link  src 192.168.35.1 
8.8.8.8 via 192.168.61.1 dev eth1 
10.100.90.2 dev tun5  proto kernel  scope link  src 10.100.90.1 
192.168.61.1 dev eth1  scope link  src 192.168.61.58 
10.100.12.0/24 via 192.168.35.2 dev tun1 
192.168.71.0/24 dev eth2  proto kernel  scope link  src 192.168.71.244 
10.100.90.0/24 via 10.100.90.2 dev tun5 
192.168.1.0/24 via 192.168.4.1 dev tun0 
10.100.20.0/24 via 192.168.36.2 dev tun2 
192.168.61.0/24 dev eth1  proto kernel  scope link  src 192.168.61.58 
10.100.1.0/24 dev eth0  proto kernel  scope link  src 10.100.1.244 
10.100.3.0/24 via 192.168.3.2 dev tun3 
10.100.2.0/24 via 192.168.2.2 dev tun4 
169.254.0.0/16 dev eth0  scope link  metric 1002 
169.254.0.0/16 dev eth1  scope link  metric 1003 
169.254.0.0/16 dev eth2  scope link  metric 1004 
[root@mail ~]#

it is all non PPPoE , it cold be matched from DB but PPPoE have no GW in DB

@filippo_carletti could you show pls
ip ru

[root@mail ~]# ip ru
0:	from all lookup local 
999:	from all lookup main 
10000:	from all fwmark 0x10000/0xf0000 lookup fweb 
10001:	from all fwmark 0x20000/0xf0000 lookup telco 
20000:	from 192.168.71.244 lookup telco 
20000:	from 192.168.61.58 lookup fweb 
20000:	from 192.168.61.3 lookup fweb 
32765:	from all lookup balance 
32767:	from all lookup default 
[root@mail ~]#

now i see the logic thanks