Wireless networking issue with Ubuntu

I must say I am really new to the networking stuff and Linux (Ubuntu 8.10). I am unable to connect to my wireless network after running these commands to change the MAC address and run in monitor mode:

airmon-ng stop wlan0 
ifconfig wlan0 down
macchanger --mac 00:11:22:33:44:55 wlan0
airmon-ng start wlan0 

The reason I did this is because I want to test how secure my wireless network is (first stopping and trying to change the MAC, and then using air-crack-ng).

Here is what I have tried to reconnect to my wireless network:

  1. Firstly I think I should change wlan0 to where it was (especially the Mac address) with the following commands:

    ifconfig mon0 down
    ifconfig wlan0 down
    macchanger --mac 00:0e:9b:ab:56:19 # myoriginalMacAddress
    airmon-ng stop wlan0
    ifconfig wlan0 up
    
  2. Secondly I tried to connect to my wireless network in my WICD but it failed at obtaining IP address after going through validating authentication. So I exited WICD and tried to do the same thing in terminal:

    $ sudo iwconfig wlan0 essid "mywireless"
    $ sudo dhclient wlan0
    There is already a pid file /var/run/dhclient.pid with pid 23682
    killed old client process, removed PID file
    Internet Systems Consortium DHCP Client V3.1.1
    Copyright 2004-2008 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    
    mon0: unknown hardware address type 803
    wmaster0: unknown hardware address type 801
    mon0: unknown hardware address type 803
    wmaster0: unknown hardware address type 801
    Listening on LPF/wlan0/00:0e:9b:ab:56:19
    Sending on   LPF/wlan0/00:0e:9b:ab:56:19
    Sending on   Socket/fallback
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
    DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
    No DHCPOFFERS received.
    No working leases in persistent database - sleeping.
    

Here is the ifconfig output of my network adapters if it can help:

$ ifconfig

eth0      Link encap:Ethernet  HWaddr 00:c0:9f:8d:23:74  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:19 Base address:0x1800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4457 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4457 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:493002 (493.0 KB)  TX bytes:493002 (493.0 KB)

wlan0     Link encap:Ethernet  HWaddr 00:0e:9b:ab:56:19  
          UP BROADCAST NOTRAILERS PROMISC ALLMULTI  MTU:576  Metric:1
          RX packets:1508929 errors:0 dropped:0 overruns:0 frame:0
          TX packets:768144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:806027375 (806.0 MB)  TX bytes:78834873 (78.8 MB)

wlan0:avahi Link encap:Ethernet  HWaddr 00:0e:9b:ab:56:19  
          inet addr:169.254.5.92  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST NOTRAILERS PROMISC ALLMULTI  MTU:576  Metric:1

wmaster0  Link encap:UNSPEC  HWaddr 00-0E-9B-CD-4E-18-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Does anyone know what my problem is and how to solve it?


Solution 1:

What version of Linux/Unix are you running, because not all commands are the same for wireless?

Command:

$ cat /etc/*-release

And why are you stopping and trying to spoof(change your MAC) before you connect to your wireless AP(access point)or wireless router, instead of just connecting to it?

This should only apply if you are planning to do some wireless pentest/auditing or to see how secure your wireless network router/ap is.

ifconfig mon0 down ifconfig wlan0 down macchanger --mac 00:0e:9b:ab:56:19 # myoriginalMacAddress airmon-ng stop wlan0 ifconfig wlan0 up

The reason you are having issues with you second command or (2) is cause of all the other unnecessary stuff you just did on number 1.