Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 重新獲取 IP 位址的快速指令:service network restart

編輯:關於 Linux

情境

換上內網網路線後 ifconfig 仍顯示舊 IP,不想重開機或重啟實驗環境。

解決指令

service network restart

執行範例

[root@localhost ~]# service network restart
正在關閉介面 eth0:                  [確定]
關閉環回介面:                        [確定]
彈出環回介面:                        [確定]
彈出介面 eth0:
正在決定 eth0 的 IP 資訊...        完成。 [確定]
[root@localhost ~]#

驗證

執行 ifconfig 即可看到新取得的 IP 位址。

結語

單一指令即可讓網卡重新向 DHCP 申請 IP,無需重開機,快速恢復網路連線。

Copyright © Windows教程網 All Rights Reserved