Why?


Search This Blog

Saturday, May 23, 2015

Centos 6.6 create bridged network

Centos 6.6 create bridged network

I am using network 192.168.10.0/24 with my gateway of 192.168.10.1 and DNS of 192.168.10.1
I have my Centos server with IP Addr of 192.168.10.100
I am using this bridge for my KVM quest images so they can be on the same network. They will use the br0 interface when setting them up

# chkconfig NetworkManager off
# service NetworkManager stop

# vi /etc/resolv.conf
search whittenberg.domain
nameserver 192.168.10.1

# vi /etc/networks
default 0.0.0.0
loopback 127.0.0.0
link-local 169.254.0.0

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=nas
GATEWAY=192.168.10.1
NETWORKING_IPV6=no


# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=74:d4:35:ea:90:1f
ONBOOT=yes
TYPE=Ethernet
UUID=a949b417-3f11-4e60-821d-20467047c8dc
BOOTPROTO=none
NETWORKING_IPV6=no
IPV6_AUTOCONF=no
#IPADDR=192.168.10.100
#NETMASK=255.255.255.0
#BROADCAST=192.168.10.255
#NETWORK=192.168.10.0
#GATEWAY=192.168.10.1
BRIDGE=br0

# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
NETWORKING_IPV6=no
IPV6_AUTOCONF=no
STP=yes
DELAY=0
IPADDR=192.168.10.100
NETMASK=255.255.255.0
BROADCAST=192.168.10.255
NETWORK=192.168.10.0
GATEWAY=192.168.10.1

# service network restart

# ifconfig
br0       Link encap:Ethernet  HWaddr 74:D4:35:EA:90:1F
          inet addr:192.168.10.100  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::76d4:35ff:feea:901f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:562054 errors:0 dropped:0 overruns:0 frame:0
          TX packets:422603 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3401299937 (3.1 GiB)  TX bytes:42579134 (40.6 MiB)

eth0      Link encap:Ethernet  HWaddr 74:D4:35:EA:90:1F
          inet6 addr: fe80::76d4:35ff:feea:901f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3402344 errors:0 dropped:94 overruns:0 frame:0
          TX packets:979938 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4841659591 (4.5 GiB)  TX bytes:93819012 (89.4 MiB)
          Interrupt:18

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:460893 errors:0 dropped:0 overruns:0 frame:0
          TX packets:460893 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6962540755 (6.4 GiB)  TX bytes:6962540755 (6.4 GiB)

vnet0     Link encap:Ethernet  HWaddr FE:54:00:96:F2:2F
          inet6 addr: fe80::fc54:ff:fe96:f22f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:205365 errors:0 dropped:0 overruns:0 frame:0
          TX packets:244950 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:15677097 (14.9 MiB)  TX bytes:324471587 (309.4 MiB)


# brctl show
bridge name     bridge id                        STP enabled     interfaces
br0                    8000.74d435ea901f       yes                    eth0




1 comment: