You are not logged in.

#1 2010-07-26 19:18:15

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

[Solved] Static IP on Arch Linux Server - Unkown Host

I'm working on a home network consisting of four machines; 2 XP Desktops, 1 AL Server and 1 AL Desktop. I'm finally trying to implement static IPs on both AL machines. Since my Linksys BEFSR41 doesn't appear to allow static DHCP leases I have tried to assign static IPs using DHCP and editing rc.conf as defined by the Arch Linux Wiki: Configuring Network. Despite trying various methods I can't ping outside my LAN. I can ping my gateway, the aforementioned router, and other machines on the network. /etc/rc.d/network restart runs without incident.

Current Setup Using DHCP IP on AL Server
/etc/conf.d/dhcpcd

DHCPCD_ARGS="-q -s 192.168.1.200"

Also of note is the fact that the DHCP address range is 192.168.1.100 to 192.168.1.149. The IP address I'm currently using (I have tried a number of different values) is outside this range.

/etc/rc.conf

eth0="dhcp"
INTERFACES=(eth0)
gateway="default gw 192.168.1.1"
ROUTES=(!gateway)

Although I have tried setting up a static IP w/out DHCP, I'm still unclear about the role of the DNS servers in /etc/resolv.conf.

I really appreciate any help you can provide. The solution may be obvious, but I can't seem to find it.

Last edited by filam (2010-07-26 20:32:03)

Offline

#2 2010-07-26 19:31:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

gateway="default gw 192.168.1.1"

<wild guess>
Try your router's IP instead.

Offline

#3 2010-07-26 20:00:33

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 449

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

looks like you cannot access anything outside your LAN so it is a gateway problem smile

delete the ! sign before gateway in the last line otherwise the gateway you specified is ignored

dns servers resolve hostnames and/or FQDN names, see the wiki ( or wikipedia )

Last edited by scar (2010-07-26 20:01:31)


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#4 2010-07-26 20:07:06

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

karol, that is my router's IP and the gateway defined by route -n.

scar, the Wiki entry has it disabled. Removing the ! causes /etc/rc.d/network restart to FAIL with the following error: SIOCDELRT: No such process.

Thank you very much for the input.

EDIT: In addition to the above error I noticed that after enabling the Gateway in rc.conf I can now ping external IP addresses (ex. 8.8.8.8), but not domain names (ex. google.com). Perhaps a DNS issue? My reslov.conf is currently empty, perhaps that is an issue?

Last edited by filam (2010-07-26 20:14:59)

Offline

#5 2010-07-26 20:14:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

From the man page:

             Here is an example which configures a static address, routes and dns.
                   dhcpcd -S ip_address=192.168.0.10/24 \
                   -S routers=192.168.0.1 \
                   -S domain_name_servers=192.168.0.1 \
                   eth0

You're using '-s' (small letter) or it's a typo?

Offline

#6 2010-07-26 20:17:32

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

karol wrote:

From the man page:

             Here is an example which configures a static address, routes and dns.
                   dhcpcd -S ip_address=192.168.0.10/24 \
                   -S routers=192.168.0.1 \
                   -S domain_name_servers=192.168.0.1 \
                   eth0

You're using '-s' (small letter) or it's a typo?

Interesting, because the Wiki entry has a lower case s. Let me check...

EDIT: Also I might note that the machine isn't having a problem assigning the IP, so I would assume this is not an issue, but let me check.

EDIT: After enabling the gateway in rc.conf and changing the flag to -S I now get the following error when running /etc/rc.d/network restart:

dhcpcd[1732]: static assignment required

I can ping 8.8.8.8, but not google.com as I mentioned before.

Last edited by filam (2010-07-26 20:21:48)

Offline

#7 2010-07-26 20:21:26

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

Have you tried using the static IP as described by the wiki:

eth0="eth0 192.168.100.2 netmask 255.255.255.0 broadcast 192.168.100.255"
INTERFACES=(eth0)
gateway="default gw 192.168.100.1"
ROUTES=(gateway)

?

Offline

#8 2010-07-26 20:31:23

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

[Solved]

I had tried that method earlier. I believe what happened was that while trying multiple methods I mixed up the configuration. No surprise there. The last part was the addition of DNS servers to resolv.conf, which I copied from another machine.

Thank you very much karol and also scar. I really appreciate the help. Hopefully I'll be able to sort out my desktop now!

Offline

#9 2010-07-26 20:33:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

Glad you got it working.

Just one more thing: does it make any difference whether it's '-S' or '-s'?

Offline

#10 2010-07-26 20:43:47

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

I got it working using the second method in the Wiki, without DHCP. Trying to use DHCP with the -S flag returns an error when restarting the network, which -s does not. After using the -s or the -S flag I can't ping anything outside the network. This is with the gateway disabled in rc.conf as the Wiki shows. When I enable it by removing the !, I can ping 8.8.8.8 but not google. Not a definitive conclusion as I'm probably doing something else wrong. hmm

EDIT: So, I do believe the lower case flag is correct, I'm still surprised that adding nameservers to resolv.conf fixes the problem, but restarting the network will cause that information to be deleted, hence I can't access domains.

Last edited by filam (2010-07-26 20:49:31)

Offline

#11 2010-07-26 20:48:18

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 449

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

if you can ping ip addresses but not FQDN names, the problem lies in the name resolution - check out your DNS servers in:

/etc/resolv.conf

( put something in, like

nameserver 194.2.0.20

- this is a free one )


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#12 2010-07-26 20:51:13

filam
Wiki Maintainer
From: Portland, ME
Registered: 2008-04-11
Posts: 158
Website

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

scar wrote:

if you can ping ip addresses but not FQDN names, the problem lies in the name resolution - check out your DNS servers in:

/etc/resolv.conf

( put something in, like

nameserver 194.2.0.20

- this is a free one )

I already made that change and flagged this thread solved. Thanks for the input anyway, I really appreciate it.

Offline

#13 2010-07-26 20:58:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

> restarting the network will cause that information to be deleted

# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
nameserver 192.168.1.1
# /etc/resolv.conf.tail can replace this line

If I'm reading that right, you create a file named ' /etc/resolv.conf.head' and put the nameservers you want there.

Offline

#14 2010-07-26 21:03:46

bobdob
Member
Registered: 2008-06-13
Posts: 138

Re: [Solved] Static IP on Arch Linux Server - Unkown Host

You can also add "nohook resolv.conf" to /etc/dhcpcd.conf to stop it overwriting /etc/resolv.conf.

Offline

Board footer

Powered by FluxBB