Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

CentOS Minimal Installation Network Configuration

DZone's Guide to

CentOS Minimal Installation Network Configuration

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

By default CentOS minimal install does not come with pre-configured network, here’s how to make it work:

$ ping google.com
ping: unknown host google.com

To fix this we’ll need to edit the set up for the ethernet. Let’s start with editing this file:

$ vim /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=x.x.x.x
BOOTPROTO=none
NETMASK=255.255.255.0
GATEWAY=y.y.y.y
DNS1=y.y.y.y
DNS2=y.y.y.y
USERCTL=yes
HWADDR='your mac address'

where x.x.x.x is your static ip, and y.y.y.y is your router ip

If you’re not sure what your mac address is, run this command

$ ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'

now edit the networks config and make sure you added the line below:

$ vi /etc/sysconfig/network

Add the line:

GATEWAY = y.y.y.y

Now restart the network interface:

$ /etc/init.d/networking restart

Now ping the router:

$ ping y.y.y.y
Request timeout for icmp_seq 0
64 bytes from y.y.y.y: icmp_seq=1 ttl=56 time=1.792 ms
Request timeout for icmp_seq 1
64 bytes from y.y.y.y: icmp_seq=3 ttl=56 time=1.790 ms
64 bytes from y.y.y.y: icmp_seq=4 ttl=56 time=1.762 ms

Looks good, now let’s see if we can see anything outside.

$ ping google.com
PING google.com (173.194.67.138) 56(84) bytes of data.
64 bytes from wi-in-f138.1e100.net (173.194.67.138): icmp_seq=1 ttl=49 time=7.88 ms
64 bytes from wi-in-f138.1e100.net (173.194.67.138): icmp_seq=2 ttl=49 time=7.35 ms
64 bytes from wi-in-f138.1e100.net (173.194.67.138): icmp_seq=3 ttl=49 time=7.13 ms

Now you can connect to the internet, and get all the packages you need.




Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:
architects ,devops ,networking ,linux ,tips and tricks ,centos

Published at DZone with permission of Kasia Gogolek, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}