ifconfig eth0 |awk '/inet/ {split($2,x,":");print x[2]}' 截图:
网络根据IP查网卡地址arping IP地址 根据IP查电脑名nmblookup -A IP地址 查看当前IP地址ifconfig eth0 |awk '/inet/ {split($2,x,":");print x[2]}' 查看当前外网的IP地址w3m -no-cookie -dump www.123cha.com|grep -o '[0-9]/{1,3/}/.[0-9]/{1,3/}/.[0-9]/{1,3/}/.[0-9]/{1,3/}' 查看当前监听80端口的程序lsof -i :80 查看当前网卡的物理地址ifconfig eth0 | head -1 | awk '{print $5}' 同一个网卡增加第二个IP地址#在网卡eth0上增加一个1.2.3.4的IP: 立即让网络支持natecho 1 | sudo tee /proc/sys/net/ipv4/ip_forward 查看路由信息netstat -rn 手工增加一条路由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 修改网卡MAC地址的方法sudo ifconfig eth0 down #关闭网卡 永久改地址方法 sudo gedit /etc/network/interfaces 在 iface eth0 inet static 后面添加一行: pre-up ifconfig eth0 hw ether 01:01:01:01:01:01 配置文件应该像如下 iface eth0 inet static 最后是 logout 或者reboot 统计当前IP连接的个数netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r -n 统计当前20000个IP包中大于100个IP包的IP地址tcpdump -tnn -c 20000 -i eth0 | awk -F "." '{print $1"."$2"."$3"."$4}' | sort | uniq -c | sort -nr | awk ' $1 > 100 ' 屏蔽IPV6echo "blacklist ipv6" | sudo tee /etc/modprobe.d/blacklist-ipv6 察看当前网络连接状况以及程序sudo netstat -atnp 查看网络连接状态netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 查看当前系统所有的监听端口nc -zv localhost 1-65535 查看网络的当前流量#安装 ethstatus 软件 查看域名的注册备案情况whois baidu.cn 查看到某一个域名的路由情况tracepath baidu.cn 重新从服务器获得IP地址sudo dhclient 从当前页面开始镜像整个网站到本地wget -r -p -np -k http://www.21cn.com 如何多线程下载sudo apt-get install axel 如何查看HTTP头w3m -dump_head http://www.example.com 快速使用http方式共享目录#进入需要共享的目录后运行: |