You are not logged in.

#1 2008-11-05 02:20:19

tonyisnt
Member
Registered: 2008-03-18
Posts: 158

DHCP works, static IP doesn't

For the past few weeks I've been booting up my computer to find that I don't have internet access.  After running /etc/rc.d/network restart, I'd still have nothing.  Only after changing my rc.conf file to work with dhcp instead of manually configuring would I get anything to go through.  I'm not entirely sure what caused this, and not 100% on when it occurred first.  I actually have been keeping up with updates recently, so I have a hunch that one of my updates changed something, somewhere, and made something go wrong.

Here is the important  part of rc.conf:

#
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
HOSTNAME="arch_linux"
#
# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available
# interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
#eth0="eth0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255"
eth0="dhcp"
INTERFACES=(lo eth0)
#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.1.1"
ROUTES=(!gateway)

When using manual configuration/static IP, the dhcp line was commented and the line above it uncommented, and the ! in front of "gateway" in my routes is removed.

Offline

#2 2008-11-05 04:23:12

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: DHCP works, static IP doesn't

Did you set your /etc/resolv.conf file correctly when using static connections? wink

Offline

#3 2008-11-05 05:45:56

ferral-cat
Member
Registered: 2008-11-03
Posts: 22

Re: DHCP works, static IP doesn't

I am having the exact same problem.  I am using XCFE and am used to having a network configuration applet where I can input my dns, ip-address, gw and so on. 

I am annoyed about haivng to edit the 3 files  in /etc/ named rc.conf + resolve.conf + hosts. 

This part of the beginner wiki is written way too cryptic:

http://wiki.archlinux.org/index.php/Beg … tc.2Fhosts

Or maybe im just an idiot. 

This line in etc/hosts/    I just dont get it:

192.168.1.100 yourhostname.domain.org  yourhostname

what is this yourhostname.domain.org?  my hostname is linuxcomputer which I chose but what am I supposed to put for domain.org?  What domain?  I dont have a domain!  Im working on a home desktop

Sorry im just ticked off.  Something as simple as changing the clock from miltary time to am/pm took me 20 minutes because I dont have an applet in XCFE to change regional settings so I had to search and search and search for a commandline way. 

Its like drinking a gallon of water with a coffee straw for me lately.  My productivity has suffered tremendously.

Offline

#4 2008-11-05 05:46:05

tonyisnt
Member
Registered: 2008-03-18
Posts: 158

Re: DHCP works, static IP doesn't

I did.  But also, when using DHCP it automatically edits the file anyways.  So, when going to static IP after using DHCP, the file will still be set correctly.

Offline

#5 2008-11-05 06:28:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: DHCP works, static IP doesn't

tonyisnt wrote:

I did.  But also, when using DHCP it automatically edits the file anyways.  So, when going to static IP after using DHCP, the file will still be set correctly.

So the output of these three commands are the same when using DHCP or Static? hmm

ifconfig
route -n
cat /etc/resolv.conf

Last edited by fukawi2 (2008-11-05 06:28:30)

Offline

#6 2008-11-05 07:20:44

creslin
Member
Registered: 2008-10-04
Posts: 241

Re: DHCP works, static IP doesn't

ferral-cat wrote:

Sorry im just ticked off.  Something as simple as changing the clock from miltary time to am/pm took me 20 minutes because I dont have an applet in XCFE to change regional settings so I had to search and search and search for a commandline way. 

Its like drinking a gallon of water with a coffee straw for me lately.  My productivity has suffered tremendously.

If the do-it-yourself aspect is irritating you so much, then don't use a do-it-yourself distro........ or at least don't complain when you choose to use it.

tonyisnt wrote:

I did.  But also, when using DHCP it automatically edits the file anyways.  So, when going to static IP after using DHCP, the file will still be set correctly.

DHCP automatically sets the file only for itself, so it doesn't set the actual DNS servers.  Try adding "-C resolv.conf" to DHCPCD_ARGS in /etc/conf.d/dhcpcd and then adding your DNS servers to /etc/resolv.conf.

Last edited by creslin (2008-11-05 07:29:06)


ARCH|awesome3.0 powered by Pentium M 750 | 512MB DDR2-533 | Radeon X300 M
The journey is the reward.

Offline

#7 2008-11-05 20:48:48

Tenken
Member
Registered: 2008-02-01
Posts: 126

Re: DHCP works, static IP doesn't

Are you using a gui program to manage your connection? Something like wicd, or networkmanager? If you are you might try telling rc.conf to not manage the interfaces by putting an "!" in front of them. Also, I know wicd needs you to disable the network daemon.

Offline

#8 2008-11-06 02:37:17

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: DHCP works, static IP doesn't

gateway="default gw 192.168.1.1"
ROUTES=(!gateway)

Try ensuring your gateway really is 192.168.1.1 and removing the ! in there.

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#9 2008-11-06 17:09:48

tonyisnt
Member
Registered: 2008-03-18
Posts: 158

Re: DHCP works, static IP doesn't

dav7 wrote:

Try ensuring your gateway really is 192.168.1.1 and removing the ! in there.

-dav7

That's definitely my router address.  I've never changed it.  And...

tonyisnt wrote:

When using manual configuration/static IP, the dhcp line was commented and the line above it uncommented, and the ! in front of "gateway" in my routes is removed.

Thanks to everyone for the suggestions.  I won't be able to try any of them until Sunday, though, probably.

Offline

#10 2008-11-10 19:14:26

tonyisnt
Member
Registered: 2008-03-18
Posts: 158

Re: DHCP works, static IP doesn't

Editing resolv.conf by hand worked.  I don't know when the change was made to make DHCP edit the file only for DHCP, but that was it.

Thanks.

Offline

Board footer

Powered by FluxBB