您的位置:首页 > Web前端

Fedora 13 成功设置静态固定IP(重启后还有效)

2010-08-11 11:00 465 查看
这个颜色是要执行的命令
这个颜色是要根据情况改变的参数

1、 打开终端,用su切换到超级用户模式,如下:
[lxy@gpon ~]$ su –m
密码:
[root@gpon ~]#

2、执行gedit /etc/sysconfig/network-scripts/ifcfg-eth0,如下:
[root@localhost neo]#vi /etc/sysconfig/network-scripts/ifcfg-eth0
我的参数设置如下:
# Intel Corporation 82567LM-3 Gigabit Network Connection
DEVICE=eth0
HWADDR=00:21:86:F8:FF:A4
ONBOOT=yes
BOOTPROTO=static <=====[页面设置不成功,则需要手动修改该值]
TYPE=Ethernet
NM_CONTROLLED=yes
USERCTL=no
IPV6INIT=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=10.96.20.150
NETMASK=255.255.0.0
DNS2=10.16.8.82
GATEWAY=10.96.1.254
DNS1=10.16.8.80
PREFIX=16
(保存退出)
3、.执行vi /etc/resolv.conf,如:
[root@gpon ~]# vi /etc/resolv.conf
我的参数设置:
# Generated by NetworkManager
nameserver 10.16.8.80
nameserver 10.16.8.82
(保存退出)
4、执行service network restart,,如:
[root@gpon ~]# service network restart
5、执行vi /etc/rc.local,如:
[[root@gpon ~]# vi /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.

touch /var/lock/subsys/local

route add -net 10.96.20.150 netmask 255.255.255.0 eth0
route add default gw 10.96.1.254 eth0
touch /var/lock/subsys/local
(保存退出)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: