您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關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: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
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: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
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: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
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信息就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。