Linux閰嶇疆闈欐€両P
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux閰嶇疆闈欐€両P相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
鍦ㄤ竴鍧桽SD鐨凜entOS閰嶇疆闈欐€両P
1. 閰嶇疆闈欐€両P
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" 璁惧鍚?/font>
NM_CONTROLLED="yes" 璁惧鏄惁琚玁etworkManager绠$悊
ONBOOT="no" 寮€鏈烘槸鍚﹀惎鍔?/font>
HWADDR="00:0C:29:59:E2:D3" 纭欢鍦板潃锛圡AC鍦板潃锛?/font>
TYPE=Ethernet 绫诲瀷
BOOTPROTO=none 鍚姩鍗忚{none|dhcp}
IPADDR=192.168.0.1 IP鍦板潃
PREFIX=24 瀛愮綉鎺╃爜
GATEWAY=192.168.0.254 榛樿缃戝叧
DNS1=202.106.0.20 涓籇NS
DOMAIN=202.106.46.151 杈呭姪DNS
2. 閲嶅惎缃戠粶鏈嶅姟
[[email protected] Desktop]# service network restart
闂灏卞湪浜庨噸鍚湇鍔″け璐ワ紝閿欒鎻愮ず濡備笅锛?/p>
Bringing up interface eth0: Error: No suitable device found: no device found for connection 鈥楽ystem eth0鈥?/span>.
[FAILED]
鎻愮ず娌℃湁“eth0”鐨勮澶囷紝姝ゆ椂鏈夊彲鑳芥槸鍥犱负绯荤粺鍦ㄥ畨瑁呮椂锛岀綉鍗$殑鍛藉悕娌℃湁eth0锛屾鏃剁敤ifconfig鏌ョ湅涓€涓嬪綋鍓嶇殑缃戝崱璁惧锛屽彂鐜扮‘瀹炴病鏈夎缃戝崱锛岃В鍐冲姙娉曟槸淇敼缃戝崱鍚嶇О銆?/font>
3. 淇敼缃戝崱鍚嶇О
鎸変互涓嬫楠わ細
1.棣栧厛鍦╲im /etc/sysconfig/grub涓坊鍔?#8220;net.ifnames=0 biosdevname=0”
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 net.ifnames=0 biosdevname=0 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
2.鐒跺悗鎵цgrub2-mkconfig -o /boot/grub2/grub.cfg鍛戒护
3.鏈€鍚庨噸鍚満鍣紝浣跨敤ifconfig鏌ョ湅缃戝崱鍚嶇О灏卞彉鎴愪簡eth0,eth1......
以上是关于Linux閰嶇疆闈欐€両P的主要内容,如果未能解决你的问题,请参考以下文章