時(shí)間:2015-06-28 00:00:00 來(lái)源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評(píng)論(1)
因?yàn)槭窃趦?nèi)網(wǎng)同一網(wǎng)段,所以只需要更改IPADDR=XXXX就可以了,詳情如下:
[root@webserver network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@webserver network-scripts]# cat ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
BROADCAST=172.23.108.255
HWADDR=00:0c:29:76:20:d1
IPADDR=172.23.108.203
NETMASK=255.255.255.128
NETWORK=172.23.108.128
ONBOOT=yes
TYPE=Ethernet
[root@webserver network-scripts]# cp ifcfg-eth0 ifcfg-eth0:1
[root@webserver network-scripts]# vi ifcfg-eth0:1
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0:1
BOOTPROTO=static
BROADCAST=172.23.108.255
HWADDR=00:0c:29:76:20:d1
IPADDR=172.23.108.220
NETMASK=255.255.255.128
NETWORK=172.23.108.128
ONBOOT=yes
TYPE=Ethernet
[root@webserver network-scripts]# service network restart
[root@webserver network-scripts]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:76:20:D1
inet addr:172.23.108.203 Bcast:172.23.108.255 Mask:255.255.255.128
inet6 addr: fe80::20c:29ff:fe76:20d1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15438968 errors:3 dropped:0 overruns:0 frame:0
TX packets:26674391 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1264636401 (1.1 GiB) TX bytes:136198354 (129.8 MiB)
Interrupt:75 Base address:0×2000
[root@webserver network-scripts]# ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:76:20:D1
inet addr:172.23.108.220 Bcast:172.23.108.255 Mask:255.255.255.128
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:75 Base address:0×2000
[root@webserver network-scripts]#
關(guān)鍵詞標(biāo)簽:CentOS,單網(wǎng)卡,IP
相關(guān)閱讀
熱門(mén)文章 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 Tomcat9.0如何安裝_Tomcat9.0環(huán)境變量配置方法 多種操作系統(tǒng)NTP客戶端配置 Linux操作系統(tǒng)修改IP
人氣排行 Linux下獲取CPUID、硬盤(pán)序列號(hào)與MAC地址 dmidecode命令查看內(nèi)存型號(hào) linux tc實(shí)現(xiàn)ip流量限制 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 linux下解壓rar文件 lcx.exe、nc.exe、sc.exe入侵中的使用方法 Ubuntu linux 關(guān)機(jī)、重啟、注銷 命令 查看linux服務(wù)器硬盤(pán)IO讀寫(xiě)負(fù)載