WAN additional info

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Lusitano
DD-WRT User


Joined: 25 Jun 2014
Posts: 141
Location: São Paulo - Brazil

PostPosted: Sun Mar 05, 2023 19:51    Post subject: WAN additional info Reply with quote
Hello there, i'm wondering if its possible to add extra info on WAN connection, like external internet IP and some additional infos..

Status_Internet.asp

Code:
Configuration Type
Connection Type Automatic Configuration - DHCP
Connection Uptime 1 day, 0:42:34
IPv4 Address 172.23.0.2/24
Gateway 172.23.0.1
IPv4 DNS 0 208.67.220.220
IPv4 DNS 1 208.67.222.123
IPv4 DNS 2 208.67.222.222
Remaining Lease Time 0 days 00:00:00


Additional IP Information

Code:
External IP Address
External IP Hostname
Country Flag & Name
Internet Provider ORG/ASN


Thank you
Sponsor
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1444
Location: Appalachian mountains, USA

PostPosted: Sun Mar 05, 2023 20:45    Post subject: Reply with quote
Lots of things you can do yourself if not allergic to sh scripting in Startup. Precede this, for example, with something (even a simple "sleep 5m" command) to be sure you've waited long enough for the interfaces of interest to be up.
Code:
logIP(){
  curl -s --interface $1 https://airvpn.dev/api/whatismyip/?format=text \
  | sed -n "s/^ip=/$1 /p" \
  | logger -t 'public IP'; }
logIP $WAN_IF
logIP tun1
for i in $(seq 1 $(nvram get oet_tunnels)); do
  [[ $(nvram get oet${i}_en) = 1 ]] \
  && [[ $(nvram get oet${i}_endpoint0) = 1 ]] \
  && logIP "oet${i}"
done

(This assumes an OpenVPN client on a machine that uses tun1 for that, and it assumes that dd-wrt on your model router has the curl utility. (Might not be so for the smaller routers.) The fancy loop at the end to find and probe all the wireguard clients would not be needed for most people. A simple "logIP oet1" or whatever would be fine. But I have a bunch of routers with lots of different configs, and a universal approach was easier for me. I used the AirVPN API (see https://airvpn.dev/faq/api/, as these are the people who provide the familiar ipleak.net that so many use interactively.

So anyway, it's something to play with. Have fun!

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum