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:
HOW TO CONFIGURE YOUR INTERFACE WITH iproute2!
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 192.168.1.66/24 dev eth0
this assigns an ip address (192.168.1.66) with a subnet mask (255.255.255.0) to the eth0 interface.
Now, we want to add a default route:
ip route add default via 192.168.1.1
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
nameserver 68.105.28.12
# /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:
208.67.222.222
208.67.220.220


*EDIT*
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