Junk Food for the Brain

Open Source and Awesomesauce :)

Fedora 16 Configure Network Interface With Static IP Address

| Comments

This post is just a reminder to myself. Due to the new Fedora Consistent Network Device Naming, a quick guide to how to ‘release’ it from the hassle of Network Manager.

  1. Determine the name of your device
[root@i7 ~]# ifconfig 
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:424 errors:0 dropped:0 overruns:0 frame:0
          TX packets:424 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31696 (30.9 KiB)  TX bytes:31696 (30.9 KiB)  
p34p1     Link encap:Ethernet  HWaddr 20:CF:30:0F:37:4A  
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::22cf:30ff:fe0f:374a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:297754 errors:0 dropped:0 overruns:0 frame:0
          TX packets:190679 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:426415608 (406.6 MiB)  TX bytes:15724959 (14.9 MiB)
          Interrupt:69 Base address:0x6000 

In my case, the device is called p34p1.

  1. Create a file in /etc/sysconfig/network-scripts called ifcfg-p34p1
  2. Contents of file:
DEVICE=p34p1
IPADDR=192.168.0.10
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
HWADDR=20:CF:30:0F:37:4A
DNS1=192.168.0.1
ONBOOT=yes
NAME=Wired_Connection
BOOTPROTO=none
NM_CONTROLLED=no
  1. Important points to note:
    • NM_CONTROLLED=no: Tell NetworkManager not to control this device
    • DNS1=192.168.0.1: The DNS Server to use
    • HWADDR: The MAC address of the NIC