Jump to content
Not connected, Your IP: 18.118.7.85
gfdgfdgfd454asaakhj

List of all entry IPs in format easy to import into UFW?

Recommended Posts

Here is a simple script in R to get server IP addresses in Windows.  You can adapt it to Linux,as R is usually included.  Someone could do the same technique in Python or Java.

 

### serverslist.txt contains a server name per line, in simple ASCII
### copy the names from the pingmatrix page
### example:
### Alathfar                                                                                                                                                                                                    
### Algedi
### Alshain
###

 

servers = read.csv("c:/airvpn/serverslist.txt", stringsAsFactors = F)
serveripaddr = c()
for (s in 1:nrow(servers))
{
    x = shell(paste0("nslookup ", servers[s,1], ".airservers.org") , intern = TRUE)
    ipaddr =gsub("^\\w*:\\s*","",x[6] , ignore.case = TRUE)
    ###  serveripaddr = c(serveripaddr, paste0(servers[s,1], "-- ", ipaddr) )   #### uncomment this line for server name -- ipaddr
    serveripaddr = c(serveripaddr,  ipaddr)
    Sys.sleep(2)
}
write.table(serveripaddr, file = "C:/airvpn/serveripaddr.txt", row.names = F, col.names = F,  quote = F)

 

 

 

Or you could scrape the XML list in Eddie to get all the IP addresses for a server instead of one each.

Share this post


Link to post

In Windows, create an AirVPN directory on C:

Create a txt file with the server names you want IP addresses for and save the file as serverslist.txt

Start R and copy and paste the code into it.  Wait for 1-2 minutes and you'll have a IP address list.

 

In Linux, R should come with the distro (like Python usually does).  You would have adapt the directory path, and the code

x = shell(paste0("nslookup ", servers[s,1], ".airservers.org") , intern = TRUE)

would have to be changed for Linux. 

 

Maybe someone can adapt it, or provide some code directly useable in Linux.

Share this post


Link to post

One problem I see is that this only gets entry IP 1.

 

Airvpn's API could help here - but unfortunately it currently doesn't seem to include data for the second generation servers (only first and second entry IP). 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...