linux FC10 FC 10 Fedora 10 static ip 無法訪問外網 DNS Generated by NetworkManager

無法使用靜態ip,不知怎麼回事,還多了個Network Manager。。輸入法也沒有

反正現在搞定了,總結一下吧!

Oh,my god!FC 10!

 

1.打開終端,用su切換到超級用戶模式,如下:
[neo@localhost ~]$ su
密碼:
[root@localhost neo]#


2.執行gedit /etc/sysconfig/network-scripts/ifcfg-eth0,如下:
[root@localhost neo]#gedit /etc/sysconfig/network-scripts/ifcfg-eth0


我的參數設置如下:
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
TYPE=Ethernet
IPADDR=192.168.0.3  #根據情況自己設吧!
NETMASK=255.255.255.0
HWADDR=00:1d:7d:e6:f5:42 #根據情況自己設吧!
GATEWAY=192.168.0.1 #根據情況自己設吧!

DNS1=202.106.0.20 #根據你的DNS,自己設吧!
DNS2=202.106.46.151
#must insert this two lines!!!!!!
(保存退出)


(

3.執行gedit /etc/resolv.conf,如:
[root@localhost neo]# gedit /etc/resolv.conf
可以看一眼,內容not need to change!:
# Generated by NetworkManager

。。。。

)


4.執行service network restart,,如:
[root@localhost neo]# service network restart


5.執行gedit /etc/rc.local,如:
[root@localhost neo]# gedit /etc/rc.local
我的參數設置:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

route add -net 192.168.0.1 netmask 255.255.255.0 eth0 #也是,根據情況自己設!
route add default gw 192.168.0.1 eth0 #也是,根據情況自己設!
touch /var/lock/subsys/local

(保存退出)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章