Skip to content

Network problems - Static IP and DHCP

Latest ubuntu ball-ache started when I wanted my wireless network to use DHCP and the ethernet to use a static address.

Long story short, KNetworkManager overrides static assignments. What a piece of crap. So I had to uninstall that and once again tackle the delights of manually setting up a PSK secured network. Settings that work for me are below. Note that they may not work for you depending on your type of encryption.

Also, its not perfect. If the access point is not fully operational at the point where it runs these scripts, it will not connect, and will not be able to connect without a restart. I don’t know why but another iwlist scan will not list any networks. Something to do with a networking restart kills the wifi card.

/etc/networking/interfaces file looks like:
—————————————-file—————————————-
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
pre-up sudo wpa_supplicant -Dwext -iwlan0 -B -c/etc/wpa_supplicant.conf
post-down sudo killall -q wpa_supplicant

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.1.1
—————————————-end—————————————-
And /etc/wpa_supplicant.conf looks like:
—————————————-file—————————————-
ap_scan=1
ctrl_interface=/var/run/wpa_supplicant

network={
ssid=”[the ssid]”
psk=”[the pass]”
key_mgmt=WPA-PSK
proto=RSN WPA
pairwise=CCMP TKIP
group=CCMP TKIP
}
—————————————-end—————————————-

{ 1 } Trackback

  1. qozacajixem | March 25, 2010 at 7:16 am | Permalink

    qozacajixem…

    Download mp3 with Mark Knight and MTV featuring E-Man