Linux – Add DHCP and DNS

How to install DHCP and DNS on Fedora / Centos / Redhat box;

yum -y install dhcp.i386 bind.i386

Set services to auto start using ntsysv — services are called “dhcpd” and “named”.

How to configure dhcp;

nano /etc/dhcpd.conf — configure as per sample provided. The sample is usually located in the same directory.
service dhcpd restart – should start without problem if done correctly

Note: dhcp range has to be on the same network as your adapter. You can run dhcpd from the command line to diagnose any issues.

How to configure bind (DNS);

I usually just forward DNS requests to my internal router. To do this just edit /etc/resolve.conf and place the following line in the file;

nameserver 192.168.9.1

Use your ip above then all should be good. Test by pinging a domain like www.yahoo.com etc… You should get an ip back even if you don’t get successful pings (due to firewall etc). nslookup is also another quick and easy way to check DNS requests.

Linux – Wireless networking

if your card is natively supported type ;

iwconfig

iwlist scanning — should also show you the wireless networks that are in range (will work if driver is loaded)

you should see wlan0 if all is good; (grab your wireless details)

iwconfig wlan0 mode managed (should already be in this mode)

there are some cool options here like “secondary” mode which the node acts as a backup master/repeater. “Repeater” – the node forwards packets between other wire-less nodes

iwconfig wlan0 channel 6 – sets wireless to channel to 6
iwconfig wlan0 essid dwireless – sets ssid to “dwireless”

K – now it gets interesting… iwconfig doesn’t support wpa2 psk out of the bag.
http://hostap.epitest.fi/wpa_supplicant/ – you want to get your hands on wpa_supplicant or similar depending on your distro. This is a good tutorial on getting it all up and running (for ubuntu, but works on other distros) http://ph.ubuntuforums.com/showthread.php?t=571188 similar one here http://www.varesano.net/blog/fabio/wpap … no+ipw2100

If you have the Asus wireless card like i did it is best to use the ndis wrapper. The native drivers do NOT work, this is even though the native driver will seem to work – detects card, and can browse the current local wireless networks. Unfortunately it cannot actually join any network (even the unencrypted ones)

do NOT just type dhclient unless you want all adapters to renew their IP’s…. ensure that you also specify the adapter.