LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2005, 12:35 AM   #1
khooke
LQ Newbie
 
Registered: Sep 2005
Posts: 4

Rep: Reputation: 0
Changing server IP address from DHCP not working


When my Fedora Core 4 server is configured to use DHCP the internet connection via my hub (on 192.168.0.1) works as expected.

I'd like to change the IP to be a fixed address, say 192.168.0.4. If I change it using
Code:
ifconfig eth0 192.168.0.4
I lose internet connectivity - it seems that I can no longer resolve domain names, and I can not ping the nameservers either.

My resolve.conf:
Code:
nameserver 206.13.31.12
nameserver 206.13.28.12
search localdomain
Output from route -e:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     *               255.255.255.0   U         0 0          0 eth0
169.254.0.0     *               255.255.0.0     U         0 0          0 eth0
default         192.168.0.1     0.0.0.0         UG        0 0          0 eth0
As soon as I change it using the ifconfig command, I can no longer access the internet. I'm assuming that this is the corect way to do this, but its obviously not working. What do I need to do to correctly change the IP address?

Thanks!
 
Old 09-25-2005, 12:57 AM   #2
debianmike
Member
 
Registered: Sep 2005
Posts: 115

Rep: Reputation: 15
i'd add netmask 255.255.255.0 and maybe even gw 192.168.0.? to your ifconfig command.

If you want to make it perminant, look at the /etc/sysconfig/network-scripts/ifcfg-eth0 file.

RH networking kind-of sucks. If you use their GUI tool, it creates a different config file somewhere else, so do a search for ifcfg-eth0 and see if you have multiple ones.

Last edited by debianmike; 09-25-2005 at 12:59 AM.
 
Old 09-25-2005, 01:19 AM   #3
khooke
LQ Newbie
 
Registered: Sep 2005
Posts: 4

Original Poster
Rep: Reputation: 0
That works great, thanks. If I add that to the command then the IP changes and I still have connectivity. I'm unsure how to make this a permanent change though, as the content in the ifcfg-eth0 file does not seem to match up with what I have in the command. Anyone else know how to do this?

Thanks!
 
Old 09-25-2005, 09:00 AM   #4
debianmike
Member
 
Registered: Sep 2005
Posts: 115

Rep: Reputation: 15
what is in ifcfg-eth0?

Should be things like:

ONBOOT=yes
USERCTL=no (or yes)
IPADDR=1.1.1.1
NETMASK=
GATEWAY= (See note below)
MACADDR=(See note below)
NETWORK=1.1.1.0
BROADCAST=1.1.1.255



Redhat monkies with the gateway...it may be in /etc/sysconfig/network instead.

MACADDR is not needed to much, but make sure it is unique on your network.

Userctl is if you want users to be able to start/stop this nic.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP Server address srbbabu Linux - Networking 1 11-05-2005 09:33 PM
eth0 not getting IP address from DHCP server Venefyxatu Linux - Networking 4 05-04-2005 06:45 PM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
DHCP server not resolving address netguy2000 Linux - Networking 6 10-07-2004 04:19 AM
dhcp server address manthram Linux - Networking 1 07-12-2002 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration