This is an old revision of the document!


Centos Networking

Centos Network interfaces examples

Static

[root@hydrogen]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
BOOTPROTO="none"
HWADDR="52:54:00:5B:C7:10"
ONBOOT="yes"
IPADDR=192.168.5.24
NETMASK=255.255.255.0
DEFROUTE=yes
[root@hydrogen]# 
$ cat /etc/sysconfig/network
HOSTNAME=server.name.pri
NETWORKING=yes
NETWORKING_IPV6=yes
GATEWAY=192.168.1.10
$ cat /etc/resolv.conf 
search mydomain.co.uk mydomain.pri
nameserver 192.168.1.1

DHCP

DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT=yes

Bonding

$ cat /etc/sysconfig/network-scripts/ifcfg-eth[0-1]
DEVICE="eth0"
HWADDR="50:E5:49:1D:75:B1"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=none

MASTER=bond0
SLAVE=yes
USERCTL=no




DEVICE="eth1"
HWADDR="00:10:18:27:62:98"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0 
DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
$ cat /etc/sysconfig/network
HOSTNAME=server.name.pri
NETWORKING=yes
NETWORKING_IPV6=yes
GATEWAY=192.168.1.10

VLAN driver

This requires the 802.1q module to talk to the Cisco switch:-

# modprobe 8021q

Not tested.

Bonding with VLAN driver and bridging

No specific switch config is required for this, but the switch ports need to be trunks not access ports.

Not tested.


rb/centosnetwork.1536345615.txt.gz · Last modified: 07/09/2018 19:40 by andrew