`
gelongmei
  • 浏览: 196632 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

linux centos 多网络配置

 
阅读更多
/etc/sysconfig/network-scripts
ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=c963ebdd-4e0f-46ff-9272-4a99a3ab980f
ONBOOT=yes
NM_CONTROLLED=yes
IPADDR=192.168.0.104
NETMASK=255.255.255.0
BOOTPROTO=static

GATEWAY=192.168.0.1

DNS1=8.8.8.8
DNS2=8.8.4.4

ifcfg-eth1
DEVICE=eth1
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="dhcp"
DNS1=8.8.8.8
DNS2=8.8.4.4

ifcfg-eth2
DEVICE=eth2
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="dhcp"
DNS1=8.8.8.8
DNS2=8.8.4.4


route-eth1
#!/bin/bash

route add default dev eth1
#route add 192.168.56.1/24 dev eth0


/etc/resolf.conf
; generated by /sbin/dhclient-script
search xxx.com yingsan2
nameserver 8.8.8.8
nameserver 8.8.4.4

注:
1、必要时需要删除文件rm -f /etc/udev/rules.d/70-persistent-net.rules
(更换网卡时)
2、需要上公网时,需要考虑route
route del default eth0
route add default eth1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics