Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
becki:linux:network_tips [2009-05-07 13:02] becki |
becki:linux:network_tips [2010-12-23 08:15] (aktuell) becki |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | [[install_config_tips|Main Slack page]] | ||
- | |||
====== Linux Networking Tips == | ====== Linux Networking Tips == | ||
===== Internet Connection == | ===== Internet Connection == | ||
+ | ==== Wireless == | ||
+ | |||
+ | See [[wireless_setup]] | ||
+ | |||
==== Wired with DSL Router == | ==== Wired with DSL Router == | ||
The DSL Router usually sets up the internet connection with [[wp>PPPOE]]. This means, on your computer you just have to enable DHCP with ''netconfig''. Thats all. | The DSL Router usually sets up the internet connection with [[wp>PPPOE]]. This means, on your computer you just have to enable DHCP with ''netconfig''. Thats all. | ||
- | |||
- | |||
- | ==== With WLAN PC-Card and DSL Router == | ||
- | |||
- | This section is compiled mainly form the [[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html|Linux Wireless LAN Howto]], [[http://www.edafe.org/slackware/|Edafe Knabe]] and a helpful [[http://www.slackforum.de/wiki/?wakka=WLanmitWPA|tutorial]] from www.SlackForum.de. | ||
- | |||
- | === Boundary conditions == | ||
- | |||
- | * OS: Slack 12 | ||
- | * A WLAN PC-Card is used as network interface card (NIC). For linux compatible cards see this [[http://linux-wless.passys.nl/|list ]] or look at the [[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/#whard|overview]] for other lists. | ||
- | * No WLAN PC-Card is inserted, no internal WLAN card is present (or no appropriate kernel module for internal card is loaded) | ||
- | * ''ifconfig -a'' at most shows your wired ethernet card (eth0) and your loopback (lo) | ||
- | * ''iwconfig'' says: | ||
- | |||
- | lo no wireless extensions | ||
- | eth0 no wireless extensions | ||
- | |||
- | === Setup == | ||
- | |||
- | * Type ''tail -f /var/log/messages'' and insert WLAN PC-Card (I used a "D-Link Air DCF-660W"). Some messages from ''/etc/rc.d/rc.inet1'' should appear. Additionally ''pccardctl ident'' gives information about the inserted card. | ||
- | * ''iwconfig'' should now reveal the name of the new wireless network interface card (NIC), typically ''eth1'' or ''eth2''. I'll exemplary use ''eth1'' here) | ||
- | * You can use ''iwlist scan'' to look for access points in range. | ||
- | * Do basic network conifguration with ''netconfig''. The easiest is to enable DHCP and let your router do all network settings. | ||
- | * ''netconfig'' can only set eth0, so open ''/etc/rc.d/rc.inte1.conf'' and move the settings of eth0 to your wireless interface. In the following example ''netconfig'' was told to just use DHCP and the wirelless NIC is eth1: | ||
- | |||
- | Before: | ||
- | <code bash> | ||
- | # Config information for eth0: | ||
- | IPADDR[0]="" | ||
- | NETMASK[0]="" | ||
- | USE_DHCP[0]="yes" | ||
- | DHCP_HOSTNAME[0]="" | ||
- | |||
- | # Config information for eth1: | ||
- | IPADDR[1]="" | ||
- | NETMASK[1]="" | ||
- | USE_DHCP[1]="" | ||
- | DHCP_HOSTNAME[1]="" | ||
- | </code> | ||
- | |||
- | After: | ||
- | <code bash> | ||
- | # Config information for eth0: | ||
- | IPADDR[0]="" | ||
- | NETMASK[0]="" | ||
- | USE_DHCP[0]="" | ||
- | DHCP_HOSTNAME[0]="" | ||
- | |||
- | # Config information for eth1: | ||
- | IPADDR[1]="" | ||
- | NETMASK[1]="" | ||
- | USE_DHCP[1]="yes" | ||
- | DHCP_HOSTNAME[1]="" | ||
- | </code> | ||
- | |||
- | * Set your DSL router to WEP security and auto channel selection. This can be done usually through a wired connection to the router and its browser interface. | ||
- | * Rember the ESSID and KEY entries of your DSL router. | ||
- | * Add ESSID and KEY to the wireless NIC section in ''/etc/rc.d/rc.inte1.conf''. Example: | ||
- | |||
- | <code bash> | ||
- | # Config information for eth1: | ||
- | IPADDR[1]="" | ||
- | NETMASK[1]="" | ||
- | USE_DHCP[1]="yes" | ||
- | DHCP_HOSTNAME[1]="" | ||
- | WLAN_ESSID[1]="Your ESSID here" # <- Add and edit this line | ||
- | WLAN_KEY[1]="Your (hexadecimal) key here" # <- Add and edit this line | ||
- | </code> | ||
- | |||
- | Notes: | ||
- | * Optionally use my [[:becki:sources:sbreconfig]] script for easily switching between wired und wireless connection settings. | ||
- | * According to [[http://www.slackbook.org/html/book.html#NETWORK-CONFIGURATION-WIRELESS|slackbook.org]] it is necessary to edit ''/etc/rc.d/rc.wireless.conf''. This is //not// necessary any more. However it is necessary to leave ''/etc/rc.d/rc.wireless'' runnable (tested). | ||
- | |||
- | ==== Use WPA instead of WEP security == | ||
- | |||
- | Basic setup like in [[network_tips#with_wlan_pc-card_and_dsl_router|With WLAN PC-Card and DSL Router]] above. The more secure WPA requires the following steps: | ||
- | |||
- | * Set your DSL router to WPA security. (Use a wired connection for this in the event of something goes wrong) | ||
- | * open ''/etc/rc.d/rc.inte1.conf'' and append the following WLAN_xxx entries to your wireless NIC section. (Remove WLAN_ESSID and WLAN_KEY entries if you used WEP before) Example: | ||
- | |||
- | <code bash> | ||
- | # Config information for eth1: | ||
- | IPADDR[1]="" | ||
- | NETMASK[1]="" | ||
- | USE_DHCP[1]="yes" | ||
- | DHCP_HOSTNAME[1]="" | ||
- | WLAN_MODE[1]="Managed" # <- Add this line | ||
- | WLAN_WPA[1]="wpa_supplicant" # <- Add this line | ||
- | WLAN_WPADRIVER[1]="wext" # <- Add this line | ||
- | </code> | ||
- | |||
- | * Reduce ''/etc/wpa_supplicant.conf'' to the following entries. Important: The psk key has to be specified in double qoutes:!: | ||
- | |||
- | <code bash> | ||
- | ctrl_interface=/var/run/wpa_supplicant | ||
- | ctrl_interface_group=0 | ||
- | eapol_version=1 | ||
- | ap_scan=1 | ||
- | fast_reauth=1 | ||
- | |||
- | network={ | ||
- | scan_ssid=0 | ||
- | ssid="your SSID here" # <- edit! | ||
- | proto=WPA | ||
- | key_mgmt=WPA-PSK | ||
- | pairwise=CCMP TKIP | ||
- | group=CCMP TKIP WEP104 WEP40 | ||
- | psk="your (hexadecimal) key here" # <- edit! Use double quotes! | ||
- | } | ||
- | </code> | ||
- | |||
- | ==== Access to public WLANs == | ||
- | |||
- | * Basic setup like in [[network_tips#use_wpa_instead_of_wep_security|Use WPA instead of WEP security]] above | ||
- | * wpa_supplicant is used, so ''/etc/rc.d/rc.inte1.conf'' has to be the same as in [[network_tips#use_wpa_instead_of_wep_security|Use WPA instead of WEP security]] above. | ||
- | * Reduce ''/etc/wpa_supplicant.conf'' to the following entries: | ||
- | |||
- | <code bash> | ||
- | ctrl_interface=/var/run/wpa_supplicant | ||
- | ctrl_interface_group=0 | ||
- | eapol_version=1 | ||
- | ap_scan=1 | ||
- | fast_reauth=1 | ||
- | |||
- | # Plaintext connection (no WPA, no IEEE 802.1X), | ||
- | # nice for hotel/airport types of WiFi network. | ||
- | network={ | ||
- | ssid="any" # <=replace with correct SSID you got from 'iwlist scan'! | ||
- | key_mgmt=NONE | ||
- | priority=2 | ||
- | } | ||
- | </code> | ||
- | |||
- | FIXME Slack 12.1 provides this template: | ||
- | |||
- | <code bash> | ||
- | network={ | ||
- | key_mgmt=NONE | ||
- | priority=0 | ||
- | } | ||
- | </code> | ||
- | |||
- | FIXME Test this in a public WLAN: | ||
- | * Will omitting the ESSID work at all? | ||
- | * What when more thane one SSIDs are available? | ||
- | * Does it work also with default ''/etc/wpa_supplicant.conf'' (where the entry for a WPA protected network is also present)? | ||
- | |||
- | FIXME The configuration of ''rc.inet1.conf'' below (where ''/etc/wpa_supplicant.conf'' is not used at all) also work for an unencrypted SOHO router. Test this in a public WLAN! | ||
- | <code bash> | ||
- | # Config information for eth1: | ||
- | IPADDR[1]="" | ||
- | NETMASK[1]="" | ||
- | USE_DHCP[1]="yes" | ||
- | DHCP_HOSTNAME[1]="" | ||
- | WLAN_ESSID[1]="Your ESSID here" # <- Add this line and fill in your ESSID | ||
- | WLAN_KEY[1]="off" # <- Add but DO NOT edit this line | ||
- | </code> | ||
- | |||
- | ==== Use a builtin Centrino 3945ABG Wlan Card == | ||
- | |||
- | FIXME As of Slack 12.1 the Intel 3945 wireless firmware is already included (Package ''iwlwifi-3945-ucode''). Thus the rest of this chapter seems to be obsolete. In order to get ''iwlist scan'' to work, on Slack 12.2 in my case it was necessary to remove and add again the appropriate kernel module ''iwl3945'' with the ''modprobe'' command. | ||
- | |||
- | This is tested on a HP Compaq 6710b Laptop running Slack 12.0 with an Intel PRO/Wireless 3945ABG Network Connection Card. The card type can be determined by looking in the output of ''lspci -v'' command. | ||
- | |||
- | According to [[http://hardware4linux.info/component/16808/|hardware4linux.info]] Slackware 12 includes the driver (along with instructions by Pat on how to set it up) under /extra | ||
- | |||
- | === Installation == | ||
- | |||
- | The following installation steps are compiled mainly form [[slackmirror>slackware-12.0/extra/intel-wlan-ipw3945/README_Slackware.TXT]] and [[slackmirror>slackware-12.0/extra/intel-wlan-ipw3945/INSTALL]] for a Slack 12.0 32 Bit System. I kept records of the individual steps in the form of a shellscript. However, for better conrol, I would recommend to issue the individual commands manually: | ||
- | |||
- | <code bash> | ||
- | url='http://ftp.gwdg.de/pub/linux/slackware/slackware-12.0/extra/intel-wlan-ipw3945/' | ||
- | module='ipw3945-1.2.1' | ||
- | ucode='ipw3945-ucode-1.14.2' | ||
- | daemon='ipw3945d-1.7.22' | ||
- | |||
- | # Download Sources | ||
- | # (Downloading the ieee80211-subsystem is not necessary | ||
- | # It is already included in Slack package kernel-modules-smp-2.6.21.5_smp-i686-2 on your system) | ||
- | wget $url/kernel-module/$module.tar.gz $url/microcode/$ucode.tgz $url/regulatory-daemon/$daemon.tgz | ||
- | |||
- | # Build kernelmodule ipw3945.ko: | ||
- | tar -xzf $module.tar.gz | ||
- | cd $module | ||
- | make | ||
- | |||
- | # Install ipw3945.ko to /lib/modules/2.6.21.5-smp/kernel/drivers/net/wireless/ | ||
- | su | ||
- | make install | ||
- | exit | ||
- | cd .. | ||
- | |||
- | # Install the microcode: | ||
- | tar -xzf $ucode.tgz | ||
- | cd $ucode | ||
- | su | ||
- | cp ipw3945.ucode /lib/firmware | ||
- | exit | ||
- | cd .. | ||
- | |||
- | # Install the regulatory daemon: | ||
- | tar -xzf $daemon.tgz | ||
- | su | ||
- | cp $daemon/x86/ipw3945d /sbin | ||
- | exit | ||
- | </code> | ||
- | |||
- | === Test == | ||
- | |||
- | * First look for a (usually blue) wireless button/LED on your laptop and switch it on. On my HP Compaq 6710b the test failed without that step. | ||
- | * Become root | ||
- | * Run ''iwconfig''. It should say something like | ||
- | |||
- | lo no wireless extensions. | ||
- | eth0 no wireless extensions. | ||
- | |||
- | * Run ''ipw3945-1.2.1/load'' | ||
- | * Run ''iwconfig'' again. You should now have a new ethernet device ''eth1'' or ''eth2'' | ||
- | |||
- | === System Configuration == | ||
- | |||
- | Note: The command ''/sbin/modprobe ipw3945'' in ''/etc/rc.d/rc.modules'' or ''/etc/rc.d/rc.netdevice'' like PV in [[slackmirror>slackware-12.0/extra/intel-wlan-ipw3945/README_Slackware.TXT]] recommends for me was //not// necessary, because KMOD or hotplug obviously loads the ipw3945 and dependencies automatically. | ||
- | |||
- | Append the following lines ''/etc/rc.d/rc.local'': | ||
- | |||
- | <code bash> | ||
- | # Start Regulatory Daemon for Intel PRO/Wireless 3945ABG Network Connection: | ||
- | /sbin/ipw3945d | ||
- | </code> | ||
- | |||
- | |||
- | After reboot you should have your wireless ethernet device available (check agagin with ''iwconfig''). Now you can continue with config by adding the MAC adress of the new ethernet device to ''/etc/rc.d/rc.wireless'' like described above in [[network_tips#with_wlan_pc-card_and_dsl_router|With PCMCIA-WLAN-Card and DSL Router]] -> Setup | ||
==== With Dsl Modem == | ==== With Dsl Modem == |