Encontre o IP público do servidor

<?phpfunction getWebPage($url){ $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data;}# try-1$url = ‘http://api.externalip.net/ip’;$content = getWebPage($url);$ip = trim($content);if(inet_pton($ip)){return …

Continuar lendo

Bash obtenha IP externo!

Obtenha IP externo ## Below command outputs external ipdig +short myip.opendns.com @resolver1.opendns.com Para adicionar isso ao bash_profile para acesso rápido ## To copy external ip to clipboardalias getmyipc=’dig +short myip.opendns.com …

Continuar lendo

Configure um IP estático no CentOS 6

vim / etc / sysconfig / network-scripts / ifcfg-ethx DEVICE=ethXBOOTPROTO=staticHWADDR=00:30:48:56:A6:2EIPADDR=”<IP_ADDRESS>”GATEWAY=”<NETWORK_GATEWAY>”NETMASK=”<NETWORK_MASK>”DNS1=”<DNS_SERVER1>”DNS2=”<DNS_SERVER2>”NM_CONTROLLED=”yes”TYPE=”Ethernet”ONBOOT=yes Exemplo: DEVICE=”eth0″BOOTPROTO=”static”HWADDR=”00:0C:29:1A:56:23″IPV6INIT=”yes”IPADDR=”192.168.131.150″NETMASK=”255.255.255.0″GATEWAY=”192.168.131.2″NM_CONTROLLED=”yes”ONBOOT=”yes”TYPE=”Ethernet”DNS1=”192.168.131.2″DNS2=”192.168.131.3″

Continuar lendo