歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> Linux操作系統下圖形界面模式更改IP地址

Linux操作系統下圖形界面模式更改IP地址

日期:2017/3/2 16:49:43   编辑:Linux服務器

1.打開終端的命令模式:

點擊左上角的application 然後點擊System Tools下拉菜單,再點擊其展開的下拉菜單Terminal,這樣就打開一個命令模式了。

2.查找所要使用的命令模塊的完全路徑,以解決"command not found"問題:

在命令模式下分別輸入:which netconfig

[root@localhost ~]# which netconfig

看看其返回的結果是不是以下信息:

/usr/sbin/netconfig

如果有返回結果的話還可以繼續使用兩個命令:"which ifconfig" 和 "which route" 查看 ifconfig 和 route 這兩個命令的路徑在甚麼地方,以前我們都以其返回結果為:/sbin/ifconfig 和 /sbin/route 為例子;

3.在命令模式下輸入命令:/usr/sbin/netconfig

這時就會顯示一個ip設置的窗口,使用鍵盤就能對其進行設置了,將ip地址 和 子網掩碼(netmask) 以及網關 輸入進去後,選擇OK 就可以了!

4.設置完之後輸入 /sbin/ifconfig 就可以查看其設置是否成功。如果成功的話在其顯示的結果中你能看到:

eth0 Link encap:Ethernet HWaddr 00:18:FE:28:1C:AA

inet addr:"ip地址" Bcast:廣播地址 Mask:子網掩碼

inet6 addr: fe80::218:feff:fe28:1caa/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3579820 errors:0 dropped:0 overruns:0 frame:0

TX packets:4311575 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:316306869 (301.6 MiB) TX bytes:1919419606 (1.7 GiB)

Interrupt:169

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:393012073 errors:0 dropped:0 overruns:0 frame:0

TX packets:393012073 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:1274688659 (1.1 GiB) TX bytes:1274688659 (1.1 GiB)

如果相應的ip地址和子網掩碼都設置上了的話就證明沒問題了!

5.如果還是不行的話就用辦法二:

還是要先打開終端命令模式,然後輸入:"/sbin/ifconfig eth1 220.195.193.86(ip地址) netmask 255.255.255.240(子網掩碼)"

然後輸入第二條命令:"/sbin/route add default gw 211.91.88.129(網關)"

備注:/sbin/ifconfig 這裡的路徑完全是使用which ifconfig 所返回的結果;

6.測試是否能上網:輸入命令ping 202.108.22.5 看看是否有返回數據

Copyright © Linux教程網 All Rights Reserved