linux搭建bridge

1、yuminstallbridge-utils

vi/etc/sysconfig/network-scripts/ifcfg-br0

pleaseusetheIPADDR,PREFIX,GATEWAY,DNS1andDNS2valuesfromthe/etc/sysconfig/network-scripts/ifcfg-eth0file);makesureyouuseTYPE=Bridge,notTYPE=Ethernet:

DEVICE="br0"

NM_CONTROLLED="yes"

ONBOOT=yes

TYPE=Bridge

BOOTPROTO=none

IPADDR=192.168.0.100

PREFIX=24

GATEWAY=192.168.0.1

DNS1=8.8.8.8

DNS2=8.8.4.4

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

name="Systembr0"

vi/etc/sysconfig/network-scripts/ifcfg-eth0

Modify/etc/sysconfig/network-scripts/ifcfg-eth0asfollows(commentoutBOOTPROTO,IPADDR,PREFIX,GATEWAY,DNS1,andDNS2andaddBRIDGE=br0):

DEVICE="eth0"

NM_CONTROLLED="yes"

ONBOOT=yes

HWADDR=00:1E:90:F3:F0:02

TYPE=Ethernet

#BOOTPROTO=none

#IPADDR=192.168.0.100

#PREFIX=24

#GATEWAY=192.168.0.1

#DNS1=8.8.8.8

#DNS2=8.8.4.4

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

name="Systemeth0"

UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03

BRIDGE=br0

/etc/init.d/networkrestart

修改完reboot

ifconfig查看状态

相关推荐