server---网络命令

1、route -n //查看路由信息
2、ifconfig enp12s0 //查看mac地址
3、arp -n //列出arp对应表
4、一组合理的网络设定包括:
IP Netmask Network Broadcast Gateway DNS
5、公有IP:由专门的机构分配。(全球唯一)
私有IP:团体、组织内部随意分配。
c类地址私有IP范围:192.168.0.0~192.168.255.255
6、网络参数设定:
ifconfig //观察网卡接口
RX:接受
TX:发送
ifconfig eth0 192.168.100.100 //设置eth0的ip
ifconfig eth0 192.168.100.100 netmask 255.255.255.0 mtu 8000 //设置ip,netmask,mut
ifconfig eth0:0 192.168.50.50 // 在一个网卡上设置多个ip
ifconfig eth0 down //关闭端口 (up:开启)
/etc/init.d/network restart //恢复默认值
路由:
route -n //观察路由
Flags:U:该路由是启动的、H:目标是一个主机 、G:需要网关来传递数据
route del -net 169.254.0.0 netmask 255.255.0.0 dev eth0 //删除网关(add,添加)
route add default gw 192.168.1.250 //添加默认网关
ip:
ip link show //显示网络接口信息
ip -s link show enp12s0 //显示详细信息
ip link set eth0 up //打开eth0接口
ip link set eth0 mtu 1000
ip link set eth0 name fm //改变接口名称 (先要关闭,才能改变名称)
ip link set eth0 address 11.11.11.11.11.11 //修改MAC
ip address show //显示接口ip
ip route show
ip route add 192.168.5.0/24 dev eth0 //增加路由
ip route del 192.168.5.0/24 //删除路由
iwlist、iwconfig //无线网卡设定
dhclient eth0 //获取ip
网络侦测与观察:
ping (ICMP协议)
ping -c 3 168.95.1.1 //ping 3 次

[fm@bogon ~]$ ping -c 3 168.95.1.1
PING 168.95.1.1 (168.95.1.1) 56(84) bytes of data.
64 bytes from 168.95.1.1: icmp_seq=1 ttl=239 time=61.5 ms
64 bytes from 168.95.1.1: icmp_seq=2 ttl=239 time=60.7 ms
64 bytes from 168.95.1.1: icmp_seq=3 ttl=239 time=62.3 ms
— 168.95.1.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 60.767/61.563/62.383/0.659 ms
注:64bytes : ICMP封包的大小
icmp_seq : 侦测的次数 (第一次、第二次…)
ttl:time to live ,每经过一个路由、桥、ttl会减1
time:相应时间
traceroute -n www.yahoo.com //侦测本机到雅虎的各个节点 (对每个节点侦测3次)(UDP)
netstat -tulnp //查看本机网络连接
netstat -tun //列出已经联机的网络
host ww.baidu.com //查看百度ip
nslookup www.baidu.com //查看ip
nslookup 168.95.1.1 //查找域名
远程连机:
talent localhost 25 //连接到本地25端口
ftp、lftp (匿名登陆)
文字浏览器:
links、wget
封包截取:
tcpdump 、wireshark
7、查看、关闭网络服务:
查找网络服务的启动脚本 :
(1)查找服务名:netstat -tunlp
(2)which rpcbind //查找命令路径
(3)rpm -qf /sbin/rpcbind //查找对应的软件名
(4)rpm -qc rpcbind //查找与软件相关的文件
(5)/etc/init.d/rpcbind  stop  //关闭 

猜你喜欢

转载自blog.csdn.net/misterfm/article/details/80717607
今日推荐