Ubuntu檢視當前IP位址

2021-05-27 00:50:44 字數 2695 閱讀 8769

ifconfig eth0 |awk '/inet/ '
截圖:arping ip位址

nmblookup -a ip位址

ifconfig eth0 |awk '/inet/ '

w3m -no-cookie -dump www.123cha.com|grep -o '[0-9]//.[0-9]//.[0-9]//.[0-9]/'

w3m -no-cookie -dump ip.loveroot.com|grep -o '[0-9]//.[0-9]//.[0-9]//.[0-9]/'

lsof -i :80

ifconfig eth0 | head -1 | awk ''

#在網絡卡eth0上增加乙個1.2.3.4的ip:

sudo ifconfig eth0:0 1.2.3.4 netmask 255.255.255.0

#刪除增加的ip:

sudo ifconfig eth0:0 down

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

sudo iptables -t nat -i postrouting -j masquerade

netstat -rn

sudo route -n

sudo route add -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1

sudo route del -net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1

sudo ifconfig eth0 down #關閉網絡卡

sudo ifconfig eth0 hw ether 00:aa:bb:cc:dd:ee #然後改位址

sudo ifconfig eth0 up #然後啟動網絡卡

永久改位址方法

sudo gedit /etc/network/inte***ces

在 iface eth0 inet static 後面新增一行:

pre-up ifconfig eth0 hw ether 01:01:01:01:01:01

配置檔案應該像如下

iface eth0 inet static

pre-up ifconfig eth0 hw ether 01:01:01:01:01:01

address 192.168.1.10

netmask 255.255.255.0

gateway 192.168.1.1

最後是 logout 或者reboot

netstat -na|grep established|awk ''|awk -f: ''|sort|uniq -c|sort -r -n

netstat -na|grep syn|awk ''|awk -f: ''|sort|uniq -c|sort -r -n

tcpdump -tnn -c 20000 -i eth0 | awk -f "." '' | sort | uniq -c | sort -nr | awk ' $1 > 100 '

echo "blacklist ipv6" | sudo tee /etc/modprobe.d/blacklist-ipv6

sudo netstat -atnp

netstat -n | awk '/^tcp/  end '

nc -zv localhost 1-65535

#安裝 ethstatus 軟體

sudo apt-get install ethstatus

#檢視 adsl 的速度

sudo ethstatus -i ppp0

#檢視 網絡卡 的速度

sudo ethstatus -i eth0

#或安裝 bwm-ng

sudo apt-get install bwm-ng

#檢視當前網路流量

· -r:在本機建立伺服器端目錄結構;

· -k: 轉換非相對鏈結為相對鏈結。

sudo apt-get install axel

axel -n 5

或者lftp -c "pget -n 5 「

w3m -dump_head 

或 curl --head

#進入需要共享的目錄後執行: 

#其它電腦使用http://ip:8000 來訪問

#自定義埠為8080:

Ubuntu檢視當前IP位址及其它網路命令

ifconfig eth0 awk inet 網路 根據ip查網絡卡位址 arping ip位址 根據ip查電腦名 nmblookup a ip位址 檢視當前ip位址 ifconfig eth0 awk inet 檢視當前外網的ip位址 w3m no cookie dump www.123cha.c...

獲取當前人IP位址

獲取訪問的ip位址 date 2018年11月26日上午11 31 49 對於通過多個 的情況,第乙個ip為客戶端真實ip,多個ip按照 分割 if ipaddress null ipaddress.length 15 return ipaddress 只需要把request的引數傳進去就可以拿到i...

linux shell檢視當前外網IP

功能飛剷更簡單,只是獲取外網ip。部分 針對curl 的ua進行處理。滿足了一下自己的蒐集癖,蒐集了不少可以用來查詢外網ip的 和方法。國內某 的介面,只返回ip curl ip.6655.curl whatismyip.akamai.com 更多用法訪問ifconfig.co wge程式設計客棧t...