본문 바로가기

반응형

myip

리눅스에서 기본 게이트웨이를 사용하는 로컬 IP 주소를 추출하는 명령어 리눅스에서 기본 게이트웨이를 사용하는 로컬 IP 주소를 추출하는 명령어 $ ifconfig eth0: flags=4163 mtu 65535 inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255 ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet) RX packets 3560 bytes 27641426 (27.6 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1906 bytes 133847 (133.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.. 더보기
[리눅스] consul 서비스 등록 - 2 consul 서비스 등록 consul nodes curl -s localhost:8500/v1/catalog/nodes | jq consul nodes leader curl -s localhost:8500/v1/status/leader consul members address list curl -s http://127.0.0.1:8500/v1/agent/members | jq -r '.[].Addr' consul domain 확인(ptr 레코드 질의) dig @127.0.0.1 -p 8600 -x {Consul Member IP} dig @127.0.0.1 -p 8600 -x {Consul Member IP} CONSUL CLIENT ADDRESS(local ip) export CONSUL_CLIENT_.. 더보기
What Is My IP?(myip) What Is My IP? bind utilities centos yum install -y bind-utils ubuntu apt-get install -y bind9-dnsutils Public IP Address dig @resolver1.opendns.com myip.opendns.com +short Private IP Address ip route get 1.2.3.4 | awk '{ print $7 }' | egrep -v '^$' 더보기
로컬 IP 및 공개 IP 찾는 방법(myip) 로컬 IP 및 공개 IP 찾는 방법(myip) vim ~/.bashrc myip() { externalip=`curl -SsfL ifconfig.co` localip=`ip route get 1.2.3.4 2>/dev/null | grep -Eo 'src [0-9.]+' | grep -Eo '[0-9.]+'` echo "Local IPADDR : $localip" echo "External IPADDR : $externalip" } source ~/.bashrc $ myip Local IPADDR : 10.100.3.188 External IPADDR : 3.14.11.88 더보기
[batch] windows 10에서 myip를 slack으로 보내기 windows 10에서 myip를 slack으로 보내기 wmyip.bat 파일 생성 @echo off setlocal enabledelayedexpansion chcp 437 FOR /F "usebackq" %%i IN (`hostname`) DO SET COMNAME=%%i @REM virtualbox IP 필터 @REM FOR /F "tokens=4 delims= " %%i in ('route print ^| find " 0.0.0.0"') do set LOCALIP=%%i @REM bridge network 사용 for /f "delims=[] tokens=2" %%i in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set LOCALIP=%%i for /f.. 더보기
myip 스크립트 myip 스크립트 .bash_profile 편집 및 적용 vim ~/.bash_profile myip() { extip=`dig @resolver1.opendns.com myip.opendns.com +short` localip=`hostname -i` echo "Local IPADDR : $localip" echo "External IPADDR : $extip" } source ~/.bash_profile 스크립트 실행 결과 myip $ myip Local IPADDR : 10.255.255.99 External IPADDR : 123.123.123.123 public ip dig @resolver1.opendns.com myip.opendns.com +short private ip hostname -.. 더보기
리눅스 공인IP 확인 리눅스 공인IP(NAT) 확인 curl ifconfig.me $ curl ifconfig.me 192.70.96.260 curl bot.whatismyipaddress.com curl http://ipecho.net/plain curl icanhazip.com curl ipv4.icanhazip.com curl ipv4.ipogre.com 참고URL - https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_%EA%B3%B5%EC%9D%B8_IP_%ED%99%95%EC%9D%B8 - http://ifconfig.me/ 더보기

728x90
반응형