Saturday, January 28, 2012

dhcpcd being a bastard and how to manually configure with iproute2 suite

Hello, and welcome to the next installation of my adventures with Arch Linux!

I got lucky on installation day and got dhcpcd to work a few times, but today was another story.
I looked at what was going on with wireshark, and it seems like dhcpcd was sending out dhcp requests, the router was replying with dhcp ack, however, dhcpcd would just request again... and again... maybe I'll get around to actually debugging dhcpcd, but until then:
So, you obviously know that Arch has deprecated the old net-tools (ifconfig, route, etc) and is using iproute2 as the standard network configuration suite.

tl;dr this is how I configured my interface to work with a standard home router:
ip addr add dev eth0
this assigns an ip address ( with a subnet mask ( to the eth0 interface.
Now, we want to add a default route:
ip route add default via
Cool! Now we need a DNS server, and we should be set. Modify the /etc/resolv.conf to contain the nameserver directive of your DNS server of choice:
# Generated by dhcpcd
# /etc/resolv.conf.head can replace this line
# /etc/resolv.conf.tail can replace this line
That's my entire resolv.conf file, I use a COX dns server (because I have that IP memorized for some reason) but you could use the great OpenDNS:

You will want to edit your /etc/rc.conf file for static ip vs. DHCP if you need to.  Seems like lots of people are having issues with the new dhcpd.

No comments:

Post a Comment