Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I enter ifconfig command, I get inet address as 192.168.1.36 for example.

But sometimes this address changes to something like 192.168.1.34 like when linux is restarted or when the router is restarted or sometimes it changes even by itself.

This causes a lot of work for me to change again configurations in my projects that needs this IP address.

I am using Fedora 13 64bit.

My DSL Model/Router box is connected to this linux box in addition to other boxes in the local area network. This in unbranded modem/router reachable via http://192.168.1.1. I am not sure if this has anything to do with the issue in this question.

share|improve this question
1  
You need to configure both your router and PC for static IP addresses. There should be an option on your router. I'm not a Linux expert and you don't give your router make/model. However, unless your projects are strictly personal you'll have to make sure that they can cope with running on other machines where the IP address will be different. You should really look into modifying them so that they can auto-detect the IP address if possible. –  ChrisF Jun 6 '11 at 9:16

1 Answer 1

up vote 3 down vote accepted

DHCP Reservation

Set a reservation in your DHCP server (your router) based on the MAC address (Ethernet address) of the Linux computer's main Ethernet interface.

You can find your Linux PC's MAC address by opening a command shell and typing /sbin/ifconfig -a and looking for HWAddr 00:af:fa:56:ef:fe

Since your DSL-router is unbranded and unidentified we cannot tell you how to do this, you might navigate to it's configuration screen and takes some screen shots to post here (edit your answer and add them to the end).

Static IP address

Alternatively, configure a static IP-address on the Linux computer and ensure the router's configuration excludes that address from it's DHCP pool.

This also requires some configuration work on your unidentified router (see above).

On Fedora, the easiest way to set a static IP address is to use the network configuration tools. I would open a shell session and use sudo system-config-network.

See http://fedoraproject.org/wiki/F8_User_Guide_-_Configuring_Internet#Static_IP_Address

Using a static address requires that you understand how to configure a default route, and probably the DNS resolver etc. I suggest it will be much easier for you to configure a DHCP reservation in your router (if it supports it).

share|improve this answer
    
I am new to Linux. Thanks for your answer but I am completely at a loss how to make use of your answer to solve my problem. I would like instructions like what commands to run etc. –  Mark Jun 6 '11 at 9:37
    
I'll update the answer. –  RedGrittyBrick Jun 6 '11 at 9:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.