感谢支持
我们一直在努力

CentOS和openSUSE单网卡双ip配置记录

CentOS和openSUSE单网卡双ip配置记录:


CentOS单网卡双ip 
cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0 
内容如下。eth0的ip是192.168.16.150网关是192.168.16.1 
[root@localhost network-scripts]# cat ifcfg-eth0   
DEVICE=”eth0″
NM_CONTROLLED=”yes”
ONBOOT=”yes”
HWADDR=00:0C:29:73:7B:2A 
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.16.150   eth0的ip
PREFIX=24
GATEWAY=192.168.16.1    eth0的网关
DNS1=114.114.144.144 
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 
[root@localhost network-scripts]# cat ifcfg-eth0:0 
DEVICE=”eth0:0″
NM_CONTROLLED=”yes”
ONBOOT=”yes”
HWADDR=00:0C:29:73:7B:2A 
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.1.150  eth0:0的ip
PREFIX=24
GATEWAY=192.168.1.1    eth0:0的网关
DNS1=114.114.144.144 
DEFROUTE=yes           
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0:0″
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03


opensuse双卡配置


#cat /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO=’static’
BROADCAST=”
ETHTOOL_OPTIONS=”
IPADDR=’192.168.2.254/27′   eth0的ip
MTU=”
NAME=’80003ES2LAN Gigabit Ethernet Controller (Copper)’
NETWORK=”
REMOTE_IPADDR=”
STARTMODE=’auto’
USERCONTROL=’no’
IPADDR_eth01=’10.10.10.254′   eth0:0的ip
NETMASK_eth01=’255.255.255.0′
LABEL_eth01=’0′


配置文件改完,只需service network restart即可

赞(0) 打赏
转载请注明出处:服务器评测 » CentOS和openSUSE单网卡双ip配置记录
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏