[OpenWrt-Devel] How to get VPN interface IP address using ubus command line?

Ronaldo Afonso ronaldo at ronaldoafonso.com.br
Fri Nov 11 11:55:31 EST 2016


  Hi all,

  Is it possible to get VPN interface IP address using ubus command line
"call"?

  Like I do using my WAN interface, as:

root at oi-eng-03:~# ubus call network.interface.wan status
{
"up": true,
"pending": false,
"available": true,
"autostart": true,
"dynamic": false,
"uptime": 3203,
"l3_device": "eth1",
"proto": "dhcp",
"device": "eth1",
"updated": [
"addresses",
"routes",
"data"
],
"metric": 0,
"delegation": true,
"ipv4-address": [
{
"address": "192.168.11.106",
"mask": 24
}
],
"ipv6-address": [
],
"ipv6-prefix": [
],
"ipv6-prefix-assignment": [
],
"route": [
{
"target": "192.168.11.1",
"mask": 32,
"nexthop": "0.0.0.0",
"source": "192.168.11.106\/32"
},
{
"target": "0.0.0.0",
"mask": 0,
"nexthop": "192.168.11.1",
"source": "192.168.11.106\/32"
}
],
"dns-server": [
],
"dns-search": [
],
"inactive": {
"ipv4-address": [
],
"ipv6-address": [
],
"route": [
],
"dns-server": [
"192.168.11.1"
],
"dns-search": [
]
},
"data": {
"leasetime": 86400
}
}


   That's how I configured my VPN interface:

root at oi-eng-03:~# uci show network.vpn
network.vpn=interface
network.vpn.ifname='tun0'
network.vpn.proto='none'

   So it get its IP address dynamically.

   It seems that I need to do some bash netifd script programming?

   Thanks in advance ...

-- 
Ronaldo Afonso
11 9 5252 0484
www.ronaldoafonso.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20161111/bfeb2a6f/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list