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.. 더보기 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 더보기 이전 1 다음