关于Linux网络管理,软件安装,进程管理分析
我就说下ifconfig和route 在我们的linux中有很多网卡接口,比如eth0第一块网卡网络接口,eno1板载⽹网卡, ens33 PCI-E⽹网卡 。CentOS 7 使⽤用了⼀致性⽹络设备命名,以上都不匹配,则使⽤ eth0 [root@node01 ~]# ifconfig eth0 eth0: error fetching interface information: Device not found [root@node01 ~]# ifconfig ens33 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.92.90 netmask 255.255.255.0 broadcast 192.168.92.255 inet6 fe80::b889:1772:c306:ef8f prefixlen 64 scopeid 0x20<link> ether 00:0c:29:07:43:5A txqueuelen 1000 (Ethernet) RX packets 910 bytes 954985 (932.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 450 bytes 38942 (38.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 网络配置文件 vim /etc/hosts网络配置文件 在配置hadoop,elasticsearch集群的时候需要在/etc/hosts配置集群IP和主机名,有时候你ping不了百度,可能域名解析不了,需要在/etc/sysconfig/network-scripts/ifcfg-eth0配置 [root@node01 ~]# vim /etc/sysconfig/network ######### HOSTNAME=node01 [root@node01 ~]# vim /etc/hosts ######### 192.168.92.90 node01 192.168.92.91 node02 192.168.92.92 node03
[root@node01 ~]# 配置DNS,域名解析服务 [root@node01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 DNS1=202.106.0.20 DNS2=8.8.8.8 网络故障排除命令 第一,ping百度:查看目标机器的网络是否可通 maoli@ubuntu:~$ ping baidu.com PING baidu.com (220.181.38.148) 56(84) bytes of data. 64 bytes from 220.181.38.148: icmp_seq=1 ttl=128 time=49.6 ms 64 bytes from 220.181.38.148: icmp_seq=2 ttl=128 time=48.2 ms ^C --- baidu.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 48.223/48.948/49.673/0.725 ms nslookup 工具就可以对域名解析, 格式是nslookup空格+域名 比如nslookup 。Server即为域名对应的ip maoli@ubuntu:~$ nslookup Server: 127.0.1.1 Address: 127.0.1.1#53
Non-authoritative answer: canonical name = Name: Address: 182.61.200.6 Name: Address: 182.61.200.7 tcpdump是一个用于截取网络分组,并输出分组内容的工具。凭借强大的功能和灵活的截取策略,使其成为类UNIX系统下用于网络分析和问题排查的首选工具 比如tcpdump -i any -n port 80 抓取所有网卡(any)80端口数据包,并且以ip形式显示(-n) (编辑:随州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |