Linux系統下網絡卡手寫配置檔案的介紹

2021-04-14 23:08:50 字數 1441 閱讀 4132

/etc/sysconfig/network-scripts/ifcfg-inte***ce-name

配置檔案ifcfg-inte***ce-name包含了初始化介面所需的大部分詳細資訊。其中inte***ce-name將根據網絡卡的型別和排序而不同,一般其名字為eth0、eth1、ppp0等,其中eth表示以太(eth0)型別網絡卡,0表示第一塊網絡卡,1表示第二塊網絡卡,而ppp0則表示第乙個point-to-poirt protocol網路介面。在ifcfg檔案中定義的各專案取決於介面型別。

(1)下面的值較問常見:

》device=name ,其中,name是物理裝置名。

》ipaddr=addr,其中,addr是ip位址。

》netmask=mask,其中,mask是網路掩碼值。

》network=addr,其中addr是網路位址。

》broadcast=addr,其中,addr是廣播位址。

》gateway=addr,其中addr是閘道器位址。

》onboot=answer,其中,answer是yes(引導時啟用裝置)或no(引導時不啟用裝置)

》userctl=answer,其中,answer是yes(非root使用者可以控制該裝置)或no

》bootproto=proto,其中,proto取下列值之一:none,引導時不使用協議;static靜態分配位址;bootp,使用bootp協議,或dhcp,使用dhcp協議。

(2)根據上述各引數的意義,設定linpcl.lintec.edu.cn機器的設定檔案如下:

[root@linpcl root]#cat /etc/sysconfig/networking/devices/ifcfg-rth0

device=eth0

onboot=yes

bootproto=static

ipaddr=192.168.0.2

netmask=255.255.255.0

gateway=192.168.0.1

(3)引數配置完畢後儲存檔案,並使用/etc/init.d/network restart命令重啟網路裝置,最新設值即可生效。

[root@linpcl root]# /etc/rc.d/init.d/network restart

正在關閉介面 eth0: [確定]

關閉環迴介面: [確定]

設定網路引數: [確定]

彈出環迴介面: [確定]

彈出介面eth0: [確定]

(4)使用ifconfig命令檢視網路裝置狀況。

[root@linpcl root]# ifconfig

eth0 link encap: ethernet hwassr 52:54:ab:28:ee:37

linet addr:192.168.0.2 bcast:192.168.0.255 mask:255.255.255.0

linux下網絡卡配置補充

redhat 9.0的網絡卡配置檔案可以位於以下三個位置。etc sysconfig network scripts ifcfg eth0 etc sysconfig networking devices ifcfg eth0 etc sysconfig networking profiles de...

Linux 下網絡卡配置引數

在 linux 下如果想修改網絡卡的引數有很多種方法,第一種方法是修改 etc network inte ces 檔案,這種方法可以在重啟後依然有效 另外一種方法是使用 ifconfig 指令,這種方法只能臨時性的修改網絡卡引數,在重啟後會失效。第一種 修改 inte ces 檔案 inte ces...

Linux環境下網絡卡配置

device eth0 hwaddr 08 00 27 0d 3c f6 type ethernet uuid 73ff4482 1baf 4c9b b859 720ca92a704a onboot yes nm controlled yes bootproto static ipaddr 192....