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

  • Why Do Some Proxies Work Fine for Search But Fail Once You Start Filtering Results?
  • Architecting Autonomous Network Ecosystems: From Reactive Monitoring to Agentic AI Orchestration
  • 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

Trending

  • Jakarta NoSQL 1.0: A Way To Bring Java and NoSQL Together
  • Everything About HTTPS and SSL in Java
  • Loop Engineering: The Layer After Prompt, Context, and Harness Engineering
  • Your Codename One App, Now A Native Mac App
  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
90.0K 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

  • Why Do Some Proxies Work Fine for Search But Fail Once You Start Filtering Results?
  • Architecting Autonomous Network Ecosystems: From Reactive Monitoring to Agentic AI Orchestration
  • 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

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