Wireless Networking

From MineOS Wiki
Jump to navigation Jump to search

Wireless configuration

Please note, if you are using any distribution other than MineOS Turnkey, it is highly recommended you follow that particular distribution's directions only. These are provided as guidelines for MineOS Turnkey users. Remember, MineOS Turnkey is based off of Debian, therefore, it is even recommended to use tutorials from Google relating to Debian and Ubuntu over these, where applicable.

Auto-joining network with DHCP (WEP network)

The steps are as follows:

  1. Edit the net file: /etc/rc.d/net
  2. Add the following lines:
/usr/sbin/iwconfig eth1 essid SSID_OF_WIFI_NETWORK key KEY_OF_WIFI
/sbin/ifconfig eth1 up
/sbin/dhcpcd eth1

Finally, save and quit with :wq

Be sure to reboot for these steps to take effect. However, if there are any problems (or you wish to test this before rebooting), you can type the above lines into the BASH prompt instead. This way, you can get immediate feedback if the configuration is successful. If successful, you will be issued an IP address which is visible through the dhcpcd step, or through ifconfig--interface 'eth1'.

Note that this process only works for WEP-enabled wireless networks. For WPA/WPA2 networks, additional utilities (included) are required.

WPA connectivity with DHCP

script output:

# wpa_passphrase SSID_OF_WIFI_NETWORK KEY_OF_WIFI > /root/wpa.conf
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:12:3F:DA:81:21  
          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:18 

eth1      Link encap:Ethernet  HWaddr 00:12:F0:AA:EF:09  
          inet addr:169.254.153.191  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:1604 (1.5 Kb)
          Interrupt:17 Base address:0xa000 Memory:dfcfd000-dfcfdfff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

# wpa_supplicant -Dwext -ieth1 -c/root/wpa.conf -B
# ifconfig eth1 up
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:12:3F:DA:81:21  
          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:18 

eth1      Link encap:Ethernet  HWaddr 00:12:F0:AA:EF:09  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10 errors:1 dropped:1 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2334 (2.2 Kb)  TX bytes:3435 (3.3 Kb)
          Interrupt:17 Base address:0xa000 Memory:dfcfd000-dfcfdfff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


Notes about WPA connectivity

  • eth1 is used in the example, but it may differ from your own hardware configuration. Note that both the wireless and wired adapters are listed as Link encap:Ethernet. When the correct device is used, there should be no output; when an incorrect device is used (such as eth0 in a setup where eth0 is wired), errors will flood the screen. Wherever eth1 is listed in a command line (lines starting with '#'), it should be substituted with the appropriate device name.
  • -Dwext is the standard, generic wireless extensions. It should work for many of the most common laptop wireless adapters. There are additional drivers available, but it is advised to use the generic ones first.
  • /root/wpa.conf is an arbitrarily chosen name for holding the wireless connection's information (SSID+un/encrypted passhrase). You may choose any name for it and any location. It is additionally advised to chmod 400 the file, allowing root to have read privileges and no other users access.

Troubleshooting

  • It is advised to use ifconfig after each step, as shown in the above output to see the progress of the connectivity. Namely, before doing anything, you can see that the IP address starts with 169.x.x.x--this is desired behavior! This indicates the wireless adapter is working, but not connected.
  • You can test connectivity immediately with ping google.com which should be returned with continuous pings at 1 second intervals. Hit Control-C to cancel the ping sequence. If you receive 'host google.com not found' (and you did not get any errors from wpa_supplicant), try typing ifconfig eth1 up again and ping once more.
  • All these actions must be done as root--all actions will fail if done by user mc.
  • If no IP address shows with ifconfig, check lspci to ensure the kernel recognizes your wireless device.
  • Though static-wireless IP allocation is possible, these steps assume that the dhcpcd service is running; ensure you have not commented it out in the /etc/rc.d/net file to get wireless working, then go for static IP if you must.

Kernel drivers

Be sure that all wireless drivers are compiled as modules, not built-in. This is because lots of hardware will depend on firmware that may be located on a mount. Thus, if wireless drivers are built-in, they will be searched-for before the filesystem is loaded/mount is accessible and initialization will fail.

If you are unsure what hardware you are using, you can use the lspci command. Identify your wireless card and be sure to include that in your kernel.

Networking support

  • [*] Wireless --->
    • [*] cfg80211 - wireless configuration API
    • [*] cfg80211 wireless extensions compatibility
    • [*] Wireless extensions sysfs files
    • [*] Common routines for IEEE802.11 drivers
      • [*] IP tables support (required for filtering/masq/NAT)
      • Mark all sub-options of IP tables support as [*] built-in

Device Drivers

  • [*] Network device support --->
    • [*] Wireless LAN --->
    • [M] Intel PRO/Wireless 2200BG and 2915ABG Network Connection

Change the above Intel driver to whatever hardware you have--be sure to include it as a module. Also note that wireless configurations may vary, though this one working configuration for a sample laptop.