Network configurations with minimal installation of Linux

Minimal installation of a linux distro in our case CentOS/RHEL/Scientific linux. is always a better idea as less packages means you are less prone to attacks & less machine overhead as well. But for that purpose you have to modify the network setting after the installation is done.

For DHCP

Open the file /etc/sysconfig/network-scripts/ifcfg-eth0
And add/modify the following lines as per your network config.

BOOTPROTO="dhcp"
ONBOOT="yes"


After modifying ifcfg_eth0 will look like this.
DEVICE="eth0"
HWADDR="08:00:27:DB:77:F4"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO="dhcp"


For static

 Open the file /etc/sysconfig/network-scripts/ifcfg-eth0
And add/modify the following lines as per your network config.

IPADDR=10.11.16.101
BOOTPROTO=none
NETMASK=255.255.255.0
GATEWAY=10.11.16.1
DNS1=10.11.16.2
DNS2=10.11.16.3
USERCTL=yes


After modifying ifcfg_eth0 will look like this.

DEVICE="eth0"
HWADDR="08:00:27:DB:77:F4"
NM_CONTROLLED="yes"

ONBOOT="yes"
IPADDR=10.11.16.101
BOOTPROTO=none
NETMASK=255.255.255.0
GATEWAY=10.11.16.1
DNS1=10.11.16.2
DNS2=10.11.16.3
USERCTL=yes

Comments

Popular posts from this blog

Using a Self signed Certificate to Run Apache2 under SSL

IPS (Image Packaging system) in Solaris 10