这篇文章将为大家详细讲解有关ifconfig为什么没有显示对应IP信息,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。
创新互联专注于济源企业网站建设,响应式网站设计,成都商城网站开发。济源网站建设公司,为济源等地区提供建站服务。全流程按需策划,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务服务器之前可以连通192.167.10.11的,现在突然ping不同了。
1、ifconfig和ip addr都看不到本机192.168.10网段的IP
2、cat /etc/sysconfig/network-scripts/ifcfg-em2发现有192.168.10网段的IP,以为网线被拔掉了,后来到机房看网线是插好的
3、继续查询才发现192.168.10网段的IP对应的ONBOOT=no,重新ifconfig em2 up后解决
[root@ebsdev ~]# history |grep mount
704 mount 192.167.10.11:/volume1/dbsbak /dbsbak
742 umount /dbsbak
--ifconfig没有显示192.168.10网段的IP
[root@ebsdev vbpbak]# ifconfig
em2 Link encap:Ethernet HWaddr A4:BA:DB:36:9B:38
inet6 addr: fe80::a6ba:dbff:fe36:9b38/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31624404 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2783785598 (2.5 GiB) TX bytes:270 (270.0 b)
128 Link encap:Ethernet HWaddr A4:BA:DB:36:9B:37
inet addr:192.168.128.172 Bcast:192.168.128.255 Mask:255.255.255.0
inet6 addr: fe80::a6ba:dbff:fe36:9b37/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:139452228 errors:0 dropped:0 overruns:0 frame:0
TX packets:31576165 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:38000646597 (35.3 GiB) TX bytes:24891534426 (23.1 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:731881261 errors:0 dropped:0 overruns:0 frame:0
TX packets:731881261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:116710422261 (108.6 GiB) TX bytes:116710422261 (108.6 GiB)
--ip addr没有显示192.168.10网段的IP
[root@ebsdev vbpbak]# ip addr
1: lo:
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: 128:
link/ether a4:ba:db:36:9b:37 brd ff:ff:ff:ff:ff:ff
inet 192.168.128.172/24 brd 192.168.128.255 scope global 128
inet6 fe80::a6ba:dbff:fe36:9b37/64 scope link
valid_lft forever preferred_lft forever
3: em2:
link/ether a4:ba:db:36:9b:38 brd ff:ff:ff:ff:ff:ff
inet6 fe80::a6ba:dbff:fe36:9b38/64 scope link
valid_lft forever preferred_lft forever
[root@ebsdev vbpbak]# cat /etc/sysconfig/network-scripts/ifcfg-128
HWADDR=A4:BA:DB:36:9B:37
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.128.172
PREFIX=24
GATEWAY=192.168.128.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=128
UUID=4c153aa8-ab08-48d0-995a-87a8e0c681a9
ONBOOT=yes
DEVICE=128
USERCTL=no
NETMASK=255.255.255.0
有192.168.10网段的IP
[root@ebsdev vbpbak]# cat /etc/sysconfig/network-scripts/ifcfg-em2
DEVICE=em2
HWADDR=a4:ba:db:36:9b:38
TYPE=Ethernet
UUID=5de6d96b-6691-4a3d-ac3c-1eda48ca9db8
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.167.10.25
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
解决方法
ifconfig em2 up
关于ifconfig为什么没有显示对应IP信息就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
网站标题:ifconfig为什么没有显示对应IP信息-创新互联
URL地址:http://lswzjz.com/article/jipos.html