linux系統(tǒng)網(wǎng)絡(luò)配置 linux服務(wù)器配置中多網(wǎng)卡的IP地址配置?
linux服務(wù)器配置中多網(wǎng)卡的IP地址配置?在Linux中,第一個(gè)網(wǎng)卡的設(shè)備名是eth0,文件是ifcfg-eth0,保存在/etc/sysconfig/network scripts/1目錄中。臨時(shí)
linux服務(wù)器配置中多網(wǎng)卡的IP地址配置?
在Linux中,第一個(gè)網(wǎng)卡的設(shè)備名是eth0,文件是ifcfg-eth0,保存在/etc/sysconfig/network scripts/1目錄中。臨時(shí)配置:ifconfig eth0 192.168.1.1 netmask 255.255.255.02。永久效果:VI/etc/sysconfig/network scripts/ifcfg-eth0。打開(kāi)此文件后,寫(xiě)入以下內(nèi)容:Device=eth0 define Device name onboot=yes boot automatically activate bootproto=static way to get IP IPADDR=192.168.1.1 IP address netmask=255.255.255.0 subnet mask gateway=192.168.1.100網(wǎng)關(guān)(根據(jù)需要,不需要寫(xiě)入),然后保存并退出,而restart服務(wù)網(wǎng)絡(luò)restart Bootproto=static意味著如果IP地址是手動(dòng)配置的,那么還應(yīng)該寫(xiě)入以下內(nèi)容。如果您自動(dòng)獲得IP地址,請(qǐng)將此段落更改為bootproto=DHCP,然后刪除以下所有內(nèi)容。同時(shí),重新啟動(dòng)服務(wù)。小貼士:注意案例。