In AA-rc1 I am trying to get the gateway of an interface:

root@OpenWrt:~# (. /lib/functions/network.sh; network_get_gateway foo wan0; 
echo $foo)

That returns nothing however.  wan0 however does have a route
configuration:

root@OpenWrt:~# ubus call network.interface.wan0 status
{
        "up": true,
        "pending": false,
        "available": true,
        "autostart": true,
        "uptime": 11222,
        "l3_device": "eth0.1",
        "proto": "dhcp",
        "device": "eth0.1",
        "metric": 0,
        "ipv4-address": [
                {
                        "address": "7.1.2.1",
                        "mask": 20
                }
        ],
        "ipv6-address": [
                
        ],
        "route": [
                
        ],
        "dns-server": [
                
        ],
        "dns-search": [
                
        ],
        "inactive": {
                "ipv4-address": [
                        
                ],
                "ipv6-address": [
                        
                ],
                "route": [
                        {
                                "target": "0.0.0.0",
                                "mask": 0,
                                "nexthop": "7.1.2.2"
                        }
                ],
                "dns-server": [
                        "2.2.1.4",
                        "2.2.10.4",
                        "2.2.10.3",
                        "2.2.1.3"
                ],
                "dns-search": [
                        "foo.net"
                ]
        },
        "data": {
                
        }
}


Am I not doing this the right way?  I can successfully get the address
using this syntax:

root@OpenWrt:~# (. /lib/functions/network.sh; network_get_ipaddr foo wan0; echo 
$foo)
7.1.2.1

As somewhat of a tangent, is this the correct way to replace calls
such as:

/sbin/uci -p /var/state get network.wan0.gateway 

which used to work in Backfire?

Cheers,
b.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to