国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識(shí)庫 >  云服務(wù)器 >  服務(wù)器教程 >  Linux如何開機(jī)自動(dòng)連接網(wǎng)絡(luò)

Linux如何開機(jī)自動(dòng)連接網(wǎng)絡(luò)

2017-01-17 16:43:23 10898

1. 編輯ifcfg-eth0eth0是系統(tǒng)中的第一塊網(wǎng)卡,1是第2塊,以此類推,找到“ONBOOT=no”,修改為“ONBOOT=yes”。

#   vi   /etc/sysconfig/network-scripts/ifcfg-eth0  #編輯eth0的配置文件#

DEVICE=eth0

HWADDR=00:00:00:00:00:00

TYPE=Ethernet

UUID=00000000-0000-0000-0000-000000000000

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.111.11

NETMASK=255.255.255.0

GATEWAY=192.168.111.1

DNS1=192.168.111.1

DNS2=222.172.200.68

2. 如果按照上面的配置都不起作用,開機(jī)后還是需要手動(dòng)去激活,可以修改“rc.local”配置文件,在文件中增加入:“ifup eth0”或者“ifconfig eth0 up”。

說明:“rc.local”是Linux系統(tǒng)中的自啟動(dòng)服務(wù)。

# vi /etc/rc.d/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

ifup eth0[root@******]# vi /etc/rc.d/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

ifup eth0  #加入eth0網(wǎng)卡啟動(dòng)項(xiàng)


提交成功!非常感謝您的反饋,我們會(huì)繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問題: