sclaggett

Switching a CentOS 6 Network Interface From Dynamic To Static

A computer needs to be assigned a static IP address if other machines on the local network need to be able to reliably connect to it. The default behavior of a CentOS 6 install is usually to obtain an IP address dynamically from the router via DHCP. This document shows how to assign a static IP to a CentOS 6 system, in this case 10.1.1.15 on the 10.1.1.0/24 subnet.

  1. Right-click on the network icon and open Connection Information.

Figure 1

  1. Make a note of the subnet, gateway and DNS servers.

Figure 2

  1. Left-click on the network icon and Disconnect the wired network.

Figure 3

  1. Right-click on the network icon and open Edit Connections….

Figure 4

  1. Select the wired network connection and click Edit….

Figure 5

  1. Change the network name to something more descriptive, e.g. "Static".

Figure 6

  1. Click on the IPv4 Settings tab and make the following changes:
    • Method: Manual
    • Add a new address.
    • Address: 10.1.1.15
    • Netmask: 255.255.255.0
    • Gateway: 10.1.1.1
    • DNS servers: 209.18.47.61, 209.18.47.62

Figure 7

  1. Apply and close the network dialog.
  2. Left-click on the network icon and enable the Static network connection.

Figure 8

  1. Test the connection by opening up a terminal window and doing to following:
    • Make sure the new network interface exists:

      Figure 9

    • Confirm the computer can reach the outside world and that name resolution is working:

      Figure 10