Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

If you use the GB Cloud CAS, you may quickly identify the current IP by opening a DOS/terminal window and using this command:

ping cloud.generalbytes.com -c 1


Your hosted server will have one (or more) IP addresses assigned to it.  CAS setup & usage requires knowledge of your PUBLIC IP. This guide will help you quickly find it.

The simplest way:

wget -qO - ipv4.icanhazip.com

Option 2: For Ubuntu (and other Debian derivatives), type on the command line:

hostname -I
  • This will list ALL configured IP's for that server. 

  • With most hosting services, the first IP will be the "public" IP.

Based on the aforementioned premise, THIS will list the public IP (only):

hostname -I | awk '{ print $1 }'
  • Copy & paste the command ( usually Shift-Ctrl-C & Shift-Ctrl-V ) to avoid mistakes.

  • Assumes the first listed IP is the "public" IP.

Option 3: Lastly, this method is yet another (more cumbersome) way to list all your server's IP addresses:

ifconfig | grep "inet addr:" | sed /:127/d | cut -f2 -d':' | cut -f1 -d' ' | head -n1

This file is required for email notifications (amongst other purposes):

/batm/config/hostname

and should contain your public IP (by itself). This can be quickly created with:

hostname -I | awk '{ print $1 }' > /batm/config/hostname
  • execute as sudo (root)!

This file is required for the admin service to function:

/batm/config/network

and should contain your public IP. This can be quickly created with:

echo "public_ip="$( wget -qO - ipv4.icanhazip.com ) > /batm/config/network
  • execute as sudo (root)!

NOTE: Digital Ocean (as of this writing) has problems with the pipe symbol ("|") when using the WEB CONSOLE.

The pipe "|" will be mistakenly converted to a ">" and the command will FAIL.

They are aware of this glitch and are working to resolve it with their vendors. In the meantime, they recommend that you use a regular SSH console to accomplish tasks & scripts involving pipes (as used in this article).

  • No labels