[Linux] Setting Static IP Addresses

Danny Rathjens linux@flux.org
Fri, 29 Jun 2007 13:52:20 -0400


Jason Alazawi wrote:
> Hey guys, I am running FC5 and I want to make my 192.168.0.89 address
> a static address that way when I open port 22 I can always get into my
> server (Yes I do have a static IP Address)  I don't know how to set
> that up.  I looked online and found that I need to make the changes in
> the /etc/networking dir. but I don't have one.  In FC5 I go
> /etc/sysconfig/networking-config then I edit the eth0 file and change
> dhcp to static but that's not working, I can't get out to the
> Internet.  Please any help would be good!
 
You could also just leave it using dhcp and configure your dhcp server
to always hand out the same ip to that particular machine based on MAC address.
e.g.:
subnet 192.168.1.0 netmask 255.255.255.0 {
              range 192.168.1.10 192.168.1.20;
              default-lease-time 43200;
              max-lease-time 86400;
              option subnet-mask 255.255.255.0;
              option broadcast-address 192.168.1.255;
              option routers 192.168.1.1;
              option domain-name-servers 192.168.1.1;
#              option domain-name-servers 205.152.144.252;
        host ur {
                hardware ethernet 00:A0:CC:24:CB:E7;
                fixed-address 192.168.1.2;
        }
}