ifconfig question

Stewart Nelson sn at scgroup.com
Fri Oct 29 00:35:40 UTC 2004


> When I run ifconfig to check my network interfaces I get this for eth0:

> eth0      Link encap:Ethernet  HWaddr 00:40:05:81:60:8E
>           inet addr:192.168.0.4  Bcast:192.168.0.255  Mask:255.255.255.0
> ...
> The entry "inet addr:192.168.0.4" should be "inet addr:192.168.0.2".  What
> file do I alter to reset this?

I am guessing that your IP address unexpectedly changed and you want it
to always be the same, e.g. because you forward some outside port(s)
to the fedora machine.  If so:

Fedora was probably set up to get an address from the router by DHCP.
If your router supports static DHCP, just configure it so that
it always hands out the same address to fedora.

If not, you should assign a static IP to your box.  If you want it
to be 192.168.0.2, first set the router's DHCP server so that the
range of addresses it hands out does not include 192.168.0.2.
Next, if some other host on your LAN is currently using 192.168.0.2,
reboot it or otherwise cause it to get a new IP from the router.
Then, go to System Settings->Network, and edit the settings for
eth0 to have a statically set IP address.  You probably want
Address: 192.168.0.2
Subnet mask: 255.255.255.0
Default gateway address: 192.168.0.1 (if that's the router's LAN address)

Also, check the DNS tab, and enter your ISP's DNS servers if needed.

--Stewart




More information about the fedora-list mailing list