• Home
  • About
  • Contact
Brandon Tillman

Minimal CentOS 6.4 install, configuring DHCP for IPV4

June 29, 2015 by Brandon Leave a Comment

When first installing CentOS 6.4 on most systems, you’ll need to configure DHCP to obtain an IPV4 IP address in order to connect to the network. This can be done by editing the network configs, you’ll need root access, so go ahead and switch users now:

[[email protected] ~]# sudo -su

Lets check to see if networking is enabled:

[[email protected] ~]# cat /etc/sysconfig/network |grep -i network

This should return NETWORKING=YES , if it does not, edit the file to make it say YES.

Lets get starting editing the config for eth0.

[[email protected] ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

You’ll see something similar to this:

DEVICE="eth0"
HWADDR="08:00:27:07:9e:57"
NM_CONTROLLED="YES"
ONBOOT="NO"
[/bash]

There are two options we want to change here:

NM_CONTROLLED="NO"
ONBOOT="YES"

Now add this to the bottom:

BOOTPROTO="dhcp"

This will allow you to grab an IP from your DHCP and essentially enable IPV4.

The whole file should now look like this:

DEVICE="eth0"
HWADDR="08:00:27:07:9e:57"
NM_CONTROLLED="NO"
ONBOOT="YES"
BOOTPROTO="dhcp"

Save and close. Now, lets restart the network service to reload with these settings.

[[email protected] ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.
                                                           [  OK  ]

Notice the ‘eth0′ – awesome! Now lets check to see if we got an IPV4 from our DHCP!

[[email protected] ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:07:9E:57
          inet addr:192.168.0.110  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe07:9e57/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24485 errors:0 dropped:0 overruns:0 frame:0
          TX packets:931 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2279234 (2.1 MiB)  TX bytes:114720 (112.0 KiB)
          Interrupt:19 Base address:0xd020

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Sweet, we’re now up and running. That wasn’t so bad!

  • Author
  • Recent Posts
Brandon
Sr. Software Engineer at Undisclosed Investment firm/Brokerage
Latest posts by Brandon (see all)
  • RadListView | Using the Telerik UI for Xamarin.Forms - August 6, 2019
  • Clean Architecture | Creating Maintainable Software using .NET Core - May 2, 2019
  • Xamarin Forms How-to: Navigation with slide out menu - August 15, 2017

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to email a link to a friend (Opens in new window)
  • Click to print (Opens in new window)

Like this:

Like Loading...

Related

Posted in: Linux Tagged: CentOS, Networking
← Easy $http requests in AngularJS
How To: Minecraft SRV Record | Hosting multiple servers without the need to specify a port →

  • Popular
  • Latest
  • Today Week Month All
  • Xamarin Forms How-to: Navigation with slide out menu Xamarin Forms How-to: Navigation with slide out menu (14,759 views)
  • Clean Architecture | Creating Maintainable Software using .NET Core Clean Architecture | Creating Maintainable Software using .NET Core (4,810 views)
  • How to: Create custom code snippets in Visual Studio Code How to: Create custom code snippets in Visual Studio Code (2,123 views)
  • AngularJs Tutorial: WoW Realm Status AngularJs Tutorial: WoW Realm Status (1,374 view)
  • Entity Framework Code-First tutorial | C# .NET MVC 5 Entity Framework Code-First tutorial | C# .NET MVC 5 (1,032 view)
  • RadListView | Using the Telerik UI for Xamarin.Forms RadListView | Using the Telerik UI for Xamarin.Forms
  • Clean Architecture | Creating Maintainable Software using .NET Core Clean Architecture | Creating Maintainable Software using .NET Core
  • Xamarin Forms How-to: Navigation with slide out menu Xamarin Forms How-to: Navigation with slide out menu
  • How to: Create custom code snippets in Visual Studio Code How to: Create custom code snippets in Visual Studio Code
  • password ASP.NET Core Identity | Change default password restrictions
Ajax spinner

Beer me!

Did one of my posts help you out? I'm glad! If you'd like to help supply my fuel for more posts - please consider donating to the cause!

10-Day Free Trial

Tags

.net .Net Core AngularJS API Architecture Authentication Blizzard API Callbacks CentOS code first commanline entity framework HTML5 http JavaScript linux minecraft Networking restful srv Telerik Template Tutorial UI vm VSCode Web web api web development Webservice wordpress Xamarin XAML

Recent Comments

  • Tillman32 on Xamarin Forms How-to: Navigation with slide out menu
  • hartman on Xamarin Forms How-to: Navigation with slide out menu
  • Tillman32 on Xamarin Forms How-to: Navigation with slide out menu
  • hartman on Xamarin Forms How-to: Navigation with slide out menu

Categories

  • .Net
  • AngularJs
  • Entity Framework
  • Featured
  • Javascript
  • Linux
  • Minecraft
  • Projects
  • Tutorial
  • Videos
  • Wordpress
  • Xamarin

Follow me on Twitter

My Tweets

Copyright © 2023 Brandon Tillman.

Omega WordPress Theme by ThemeHall

%d bloggers like this: