IP Network Config

When adding a new interface:


Get the MAC address:

[gattis@webseal3 network-scripts]$ ip -o link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN \    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000\    link/ether 00:50:56:a8:33:9c brd ff:ff:ff:ff:ff:ff
3: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000\    link/ether 00:50:56:a8:41:1e brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000\    link/ether 00:50:56:a8:46:e4 brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000\    link/ether 00:50:56:a8:42:61 brd ff:ff:ff:ff:ff:ff
6: eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000\    link/ether 00:50:56:a8:2a:f8 brd ff:ff:ff:ff:ff:ff

Edit the interface start script:

cd /etc/sysconfig/network-scripts/
sudo cp ifcfg-eth3 ifcfg-eth5
vim ... change MAC and name to match above

sudo service network restart


Adding persistent routes

There are several ways to do this with Redhat systems, but the best is documented here. In short, create a new file for the network scripts to consume.

sudo vim /etc/sysconfig/network-scripts/route-eth0

10.10.20.0/24 via 10.17.255.215 dev eth0

This corresponds to the route command of

sudo route add -net 10.10.20.0 netmask 255.255.255.0 gw 10.17.255.215

When you have multiple homes, you can add additional networks if you know the gateways. 

cat /etc/sysconfig/network-scripts/route-eth1
10.10.8.0/23 via 10.10.8.136 dev eth1
10.10.0.0/24 via 10.10.9.254 dev eth1

Comments