网络: ifconfig:查看网卡相关信息 ifconfig eth0 up|down 启动关闭指定网卡 ifconfig eth0:1 192.168.1.100 ip addr 配置文件:
网络:
ifconfig:查看网卡相关信息
ifconfig eth0 up|down 启动关闭指定网卡
ifconfig eth0:1 192.168.1.100
ip addr
配置文件:/etc/sysconfig/network-scripts/ifcfg-eth0....
dhcp 自动获取
route:查看路由表
route -n 不打印主机名
route -add host|net
route -del host|net
格式:route -n
格式:/sbin/route -n
netstat:查看网络相关的详细信息
netstat -anutlp|grep :22
查看22号端口相关的网络信息
netstat -anutlp|grep sshd
查看进程名为sshd相关网络信息
netstat -anutlp |grep 11112(PID)
查看进程号为11112的网络相关信息
通过进程号找到执行程序路径
ps-ef|grep pid(进程号) 查询进程
lsof -p pid---
ll /proc/pid
arp:查看本机上的arp列表
arp -a 使用bsd形式输出
arp -s 设置一个arp表项。
arp -d 删除一个arp表项。
arping:ping的时候显示MAC地址
nmap:扫描工具
1) 获取远程主机的系统类型及开放端口
nmap -sS -P0 -sV -O <target>
2)在网络寻找所有在线主机
nmap -sP 192.168.0.*
3)显示目标主机的TCP
nmap -sT 127.0.0.1
4)显示目标主机UDP
nmap -sU 127.0.0.1
ping:测试网络联通性
ping -c 设置完成要求回应的次数。
ping -s 设置数据包的大小。
traceroute:测试到目标主机所经过的跳数(hops)
traceroute -m 设置检测数据包的最大存活数值TTL的大小。
traceroute -w 设置等待远端主机回报的时间。
traceroute -q
traceroute -n 直接使用IP地址而非主机名称。