Pages

Showing posts with label WiFi. Show all posts
Showing posts with label WiFi. Show all posts

August 23, 2014

Changing DNS nameservers in aptosid + wpa_gui

This is a corner-case quickie.

I use the Debian-sid derivative aptosid as my main OS along with the blessed-by-aptosid wpa_gui for wlan management. There are reasons I prefer wpa_gui to the aptosid default Ceni--but this is the subject for another post, perhaps.

Unlike other GUI wlan management tools such as wicd or Network Manager, wpa_gui doesn't provide an obvious way to change your DNS nameserver(s). I ran into this problem recently when I was in filter-happy Turkey and the modem+router I bought there had firmware in which the DNS nameserver setting was disabled.

I solved the problem for my machine by editing /etc/dhcp/dhclient.conf. I decommented the line:
#prepend domain-name-servers 127.0.0.1;
and then changed 127.0.0.1 to a comma-separated list of the desired DNS servers, e.g.:
prepend domain-name-servers 208.67.222.222, 208.67.220.220;
(for OpenDNS).

Reboot, and a
$ dig google.com
showed that it worked.

I can't say it'll work on every machine, but it worked for me.

September 16, 2008

Oldschool wireless

There's a really good guide to setting up WiFi without using NetworkManager at http://ubuntuforums.org/showthread.php?t=202834.

Why would you want to do this? Because when you do, the wireless LAN connection comes up automatically when you boot the machine. This is a really good idea if you are running any servers (e.g., the outrageously fun MPD). Of course it's a really bad idea to run a server off a wireless connection whether it comes up automatically or not, but sometimes you just can't snake cables where you want your machine to be. And if you're not running any servers, it spares you the bother of having to type in connection authorization at login. If you do a lot of roaming, then giving up NetworkManager (or the similar netapplet) may not be such a great idea; but if you don't, this approach may save you from some bother.

The only things I would add to what is posted in the Ubuntu forum are:
  1. You can include more that one interface in the /etc/network/interfaces file.
  2. If you use a network interface card that is removable (PCMCIA, USB, etc.) you may get better results if you specify it as allow-hotplug rather than auto.
  3. If you do specify an interface as allow-hotplug rather than auto, issuing the
    sudo /etc/init.d/networking restart
    command won't bring up the interface(s). To do that you will need to issue
    ifup < the_name_of_the_interface >
My main SkinnyDebbie test machine has one PCMCIA slot and no built-in networking. I tend to swap out a wireless and a wired Ethernet card. My /etc/network/interfaces file looks like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
#auto eth0
iface eth0 inet dhcp

allow-hotplug ath0
#auto ath0
iface ath0 inet dhcp
wpa-driver madwifi
wpa-ssid ufart
wpa-ap-scan 1
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-key-mgmt WPA-PSK
wpa-psk <>
Of course, your details will differ.

September 09, 2008

MadWifi and SkinnyDebbie

My main SkinnyDebbie test machine is an Acer TravelMate 508T laptop. It has no built-in Ethernet. I don't think I need to say that it has no built-in WiFi. It has one PCMCIA slot.

I use a 3Com OfficeConnect 10/100 LAN adapter card (PCMCIA) for Ethernet connectivity. I've never had to do anything special to make the lappy's networking go with any Linux distribution I have tried. It just works "out of the box." I also have a D-Link DWL-G630 WiFi card (also PCMCIA). It works "out of the box" in Xubuntu, but not in SkinnyDebbie. This is a summary of how I got it to work.

I bought the D-Link card because it was listed as Linux compatible at http://linux-wless.passys.nl/ (and because of favorable comments at Newegg). The site says that my card is compatible with MadWifi drivers--drivers that have been developed to support Atheros chipsets. The process below is adapted from MadWifi's own newbie installation guide; however, I had to do some extra stuff and not do some other stuff to make it go in SkinnyDebbie. I expect that the instructions below will work for any MadWifi-compatible card. There are lots of little steps here, none of which are large or complicated, but all of which add up to some tedium. Sorry about that.

Preparation
  1. I started with my wired Ethernet card in the laptop. The WiFi card was not physically in the machine.
  2. Verify that your WiFi card is compatible with the MadWifi drivers at http://linux-wless.passys.nl/. Be sure to check the vendor/product code of your card as well as the product ID because manufacturer's routinely change chipsets in their cards without changing model numbers! If it's not listed as working with MadWifi, then don't install the MadWifi drivers.
  3. Open a terminal and type:
    sudo aptitude install network-manager network-manager-gnome
    This will install a network management system and notification tray applet that takes a lot of the headache out of setting up and signing on to WiFi networks.
  4. When that's done, type
    sudo aptitude install module-assistant build-essential
  5. When that's done, type
    sudo m-a update
    sudo m-a prepare

    The above will install the header files needed to build the MadWifi drivers.
  6. When that's done, type
    geany ~/.icewm/startup
    In the text editor window that opens, right after the line
    xscreensaver -no-splash &
    add the line
    nm-applet --sm-disable &
    Save the file and exit Geany.
Build and install drivers
  1. Download the drivers from the Madwifi home page. I used v0.9.4. If something doesn't work in what follows, it may be because of a version change.
  2. In ROX-Filer, navigate to the *.tar.gz file you downloaded and double click on it to extract it.
  3. Open a terminal and navigate to the directory where you extracted the package. (This may be a good time to get to know ROX-Filer's Window -> Terminal here command or it's keyboard shortcut, `.)
  4. Type the following in the terminal:
    sudo ifconfig ath0 down
    sudo ifconfig wifi0 down

    You will probably get warnings or errors. Don't worry about them.
  5. Now type the following:
    cd scripts
    ./madwifi-unload
    ./find-madwifi-modules.sh $(uname -r)
    cd ..

    This removes any old modules, which you almost certainly don't have anyway. We are now ready to build the drivers.
  6. Still in the terminal, make sure you are at the top level of the downloaded and extracted MadWifi directory and type:
    sudo make
    sudo make install

    Both of the above may take some time. You should not see errors. If you do, curse the Linux gods and give up.
  7. Type:
    sudo geany /etc/modules
    In the text editor window that opens, add the following line to the bottom:
    ath_pci
    Save the file and exit Geany.
  8. Logoff and power down the computer. Replace the wired Ethernet adapter card with the WiFi adapter card.
  9. When you start the computer and login again, you should see a new icon in the notification tray. When you click on it, you will be able to select and sign into available WiFi networks
There remains one minor problem with this setup: every time you reboot your computer and login, you will be prompted to re-enter the passphrase for the network you want to join. Improving on this situation is probably possible, but it's not something I am going to tackle right now. If I do, you'll read about it here.