DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture
  • An AI-Driven Architecture for Autonomous Network Operations (NetOps)

Trending

  • From 24 Hours to 2 Hours: How We Fixed a Broken BI System With Apache Airflow
  • Why Your Test Automation Is Always Behind the Code And the Architecture That Fixes It
  • 5 Failure Patterns That Break AI Chatbots in Production
  • Skills, Java 17, and Theme Accents
  1. DZone
  2. Data Engineering
  3. IoT
  4. CentOS Minimal Installation Network Configuration

CentOS Minimal Installation Network Configuration

By 
Kasia Gogolek user avatar
Kasia Gogolek
·
Nov. 26, 12 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
89.9K Views

Join the DZone community and get the full member experience.

Join For Free

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.




Network

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

Opinions expressed by DZone contributors are their own.

Related

  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture
  • An AI-Driven Architecture for Autonomous Network Operations (NetOps)

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook