Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
(I have a bcmwl5.inf/sys ndis-wrapped, and my laptop onboard Broadcom WiFi card running great with 64bit WEP.)
If I do 'ifconfig wlan0 192.168.1.100', 'ifconfig' returns that this .100 has been assigned; I then can't connect to the internet however.
If I then do 'dhcpcd wlan0', .104 gets assigned to wlan0 and I CAN access the internet.
My dhcp-enabled WRT54G router issues IP addys in the range 192.168.100-105.
Under XP, I statically assign .100 and .101 to my laptop LAN & WLAN ports; I assign .102 to my desktop WLAN port; .103 to my networked PS2 and .105 to my media centre.
I know it looks like .104 is a natural assignment, but if I switch EVERY networked device off, then run my two PCs under Linux, why:
1. Can I not assign an IP statically to the two machines, and
2. Why are .100 and .101 not the first dhcpcd IP assignments
These 4 lines are in my /etc/rc.d/rc.inet1.conf:
#IFNAME[4]="wlan0"
#IPADDR[4]="192.168.1.101"
NETMASK[4]="255.255.255.0"
USE_DHCP[4]=""
Should I remove the two #, and then set DHCP[4]="No"?
I really want to be able to statically assign the same IP addresses to my hardware under Linux as I do under XP, as my PS2 and media centre are dependent on having the addresses assigned to them.
One thing that might be happening is that your router might be keeping those IP's checked out to the other machines. I think generally, the DHCP of the WRT54G logs the MAC address of the machine logging on and then assigns and IP. These are kept in the system for X amount of time before they're automatically recycled. So even though you've turned off the machines, their MAC is still registered with an IP. Then when you assign a static IP that was in use by another machine, it might not let you connect since the MAC doesn't match. That's mostly speculation by me, but you could verify it by releasing all the ip's before turning the machines off, and then trying it.
What I do with my home network is to use "static" DHCP. On my WRT54G there's a page where you can assign specific IP's to specific MAC addresses. So I entered all of my MAC's and assigned them an IP so they're always the same. Then it's easy for me to limit the available addresses to only fit the number of machines I connect.
DHCP assigns more than just the IP address. It also edits /etc/resolv.conf on the fly, sets the netmask, and gives the values for Default gateway and the nameservers. If you don't use DHCP, there is more you need to configure.
...
I know it looks like .104 is a natural assignment, but if I switch EVERY networked device off, then run my two PCs under Linux, why:
1. Can I not assign an IP statically to the two machines, and
2. Why are .100 and .101 not the first dhcpcd IP assignments
...
jschiwal pretty much answered #1, #2 is likely due to the way the DHCP server (the WRT54G) hands out leases. As an example Linux DHCP servers assign addresses from the top of their pool down, windows servers usually assign addresses from the bottom up. It's also good practice that if you are setting static IP addresses to make sure they are not in the DHCP range.
Oh, I thought my static IPs needed to be in the DHCP range; for some reason I thought anything outside of that range would not be served by the router.
Anyhow. If I do NOT use DHCPCD, I can not get an internet connection. Which of my config files should I post here in order to get help on assigning static IPs under Linux that match my statics under XP.
In windows you could run "ipconfig /all" and jot down the 1) IP address 2) Default Gateway address 3) Netmask 4) DNS addresses 5) WINS server address if any.
Then use the same values to statically configure you box when it is using Linux. The IP address could be any in the legal range of your subnet. Sometimes when you are running a certain type of server, a static IP address works best. I would pick one outside the range of address that the Router supplies. Or you could turn off the DHCP server function on the router also.
The DNS address is usually referred to as Nameserver in Linux. The two names are synonymous.
In the config files, lines that start with the octothorpe character are comments.
I don't use slackware so some of the items may go into different files.
/etc/resolve.conf contains the nameserver addresses (dns)
There may be an /etc/route.conf file. Or it may have moved to /etc/sysconfig/network/ and may not even be used. Sometimes this is entered dynamically during bootup based on other config files.
Try posting the output of "sudo /sbin/ifconfig" and "/sbin/route".
Also, if you are able to communicate between two local hosts, but not connect to the internet, the reason is usually either the gateway address is wrong (/etc/route.conf), or the nameserver addresses are wrong (/etc/resolve.conf).
From your post, I take it that slackware doesn't use interface config files in /etc/sysconfig/network/ with names like "ifcfg-eth0". In SuSE and others, a generalized startup service will source the config files in /etc/sysconfig/network/, instead of having the information explicitly entered. For example, each interface has its own config file; e.g. ifcfg-eth0. This makes the service scripts harder to follow, but is necessary if hotplugging is used. And there is a one-to-one mapping between gui configuration dialog and a particular config file.
If slackware supports network interface hotplugging, there may be a similar move to generalize the startup scripts. Please check if you have a /etc/sysconfig/network/ directory and look for any README files on changes, such as whether /etc/route.conf is still used.
If your system has both a NIC interface and a wireless interface, and they aren't assigned to different subnets, make sure the interface that you are not using is shut off.
Also, while this is unlikely, don't use any scripts or configuration files that were prepared in windows. Sed scripts and make files can fail due to invisible linefeeds for example.
I hope I gave you some ideas to try. Someone who actually uses slackware may be able to provide better specific slackware configuration help. Some slackware how-to's on the net may be helpful, but they could be dated. Look for documentation that comes with your system first.
/etc/rc.d/rc.inet1.conf
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").
# Config information for eth0:
IPADDR[0]="192.168.1.100"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""
# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""
# Default gateway IP address:
GATEWAY="192.168.1.1"
# Change this to "yes" for debugging output to stdout. Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"
## Example config information for wlan0. Uncomment the lines you need and fill
## in your configuration settings.
# (You probably will not need all of these for your own wireless network):
#IFNAME[4]="wlan0"
#IPADDR[4]="192.168.1.101"
#NETMASK[4]="255.255.255.0"
#USE_DHCP[4]=""
#DHCP_HOSTNAME[4]="icculus-wireless"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
#SCRIPT[4]="/etc/rc.d/ifcfg/ifmetric.sh"
#WLAN_ESSID[4]=sn55ge #BARRIER
#WLAN_MODE[4]=Managed
#WLAN_RATE[4]="54M auto"
#WLAN_CHANNEL[4]="1"
#WLAN_KEY[4]="xxxxxxxxxx" # 10 character 64bit HEX WEP key
#WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=xxxxdc66eaf7e6efd5b5523ae43c7925ff4df2f8b7099495192d44a774fda16" # my WPA-PSK - not working yet!
#WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"
#WLAN_WPAWAIT[4]=30
## Some additional network parameters that you can use are explained below.
## Taking the configuration for wlan0 as an example:
#IFNAME[4]="wlan0" # Use a different interface name instead of
# the default 'eth4'
#HWADDR[4]="00:01:23:45:67:89" # Overrule the card's hardware MAC address
#MTU[4]="" # The default MTU is 1500, but you might need
# 1360 when you use NAT'ed IPSec traffic.
#DHCP_TIMEOUT[4]=15 # The default timeout for the DHCP client to
# wait for server resonse is 60 seconds, but
# you might want a shorter wait.
#DHCP_KEEPRESOLV[4]="yes" # If you dont want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes" # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes" # If you don't want the DHCP server to change
# your default gateway
#DHCP_IPADDR[4]="" # Request a specific IP address from the DHCP
# server
#WLAN_ESSID[4]=DARKSTAR # An example of how you can override _any_
# parameter defined in rc.wireless.conf, by
# prepending 'WLAN_' to the parameter's name.
# Useful with multiple wireless interfaces.
#WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=thekey"
# Some drivers require a private ioctl to be
# set through the iwpriv command. If more than
# one is required, you can place them in the
# IWPRIV parameter (space-separated, see the
# example).
#WLAN_WPA[4]="wpa_supplicant" # Run wpa_supplicant for WPA support
#WLAN_WPADRIVER[4]="ndiswrapper"# Tell wpa_supplicant to specifically use the
# ndiswrapper driver
#WLAN_WPAWAIT[4]=30 # In case it takes long for the WPA association
# to finish, you can increase the wait time
# (defaults to 10 seconds)
#SCRIPT[4]="/etc/rc.d/ifcfg/ifmetric.sh"
# use a custom interface configuration script
# (example scripts are in the ifcfg directory)
spc,
From the output you posted above, it appears that you have a wired eth0 and the wireless wlan0 on the same IP subnet. If you have them both on the same LAN, the kernel will only use one of them to connect with, if you have eth0 unplugged but still "UP" this could be the cause of your network connectivity problems. This is confirmed by the routing table output, which shows two default routes.
The instructions for the wireless section [of rc.inet1.conf?] show, "Example config information for wlan0. Uncomment the lines you need and fill in your configuration settings." It appears that you have placed settings in there but forgot to uncomment the lines, do that by taking the hash mark # out from in front of the lines you are using. It also wouldn't hurt to take a peek at your rc.inet1 and see if/where it sets up wireless, with the extra settings it needs over wired interfaces. It may or may not try to start a 4th interface or start it as a wireless interface. In the case section at the bottom of rc.inet1 make sure that 'start' and * have an interface up and 'stop' has an interface down for your wireless. I don't have a slack 10 system I can peek at but if the wireless settings were already in your conf then there is probably a wlan_up section in inet1 that just needs to be set to use the 4th interface settings in the config file:
Code:
case "$1" in
'start') # "start" brings up all available interfaces:
lo_up
eth_up 0
eth_up 1
eth_up 2
eth_up 3
wlan_up 4
gateway_up
;;
'stop') # "stop" takes down all existing interfaces:
gateway_down
wlan_down 4
eth_down 3
eth_down 2
eth_down 1
eth_down 0
lo_down
;;
*) # The default is to bring up all interfaces:
lo_up
eth_up 0
eth_up 1
eth_up 2
eth_up 3
wlan_up 4
gateway_up
esac
jschiwal et al,
Slackware places all the network interface config settings into /etc/rc.d/rc.inet1.conf which is a config file used by the /etc/rc.d/rc.inet1 script to start all network interfaces. It includes the default route (gateway= in rc.inet1.conf) although the nameservers are still listed in /etc/resolv.conf. Rather than a seperate readme, all the startup scripts in /etc/rc.d/ are very heavily documented so that once you realize it is BSD-style startup and not System V, it is (usually) incredibly easy to follow.
The instructions for the wireless section [of rc.inet1.conf?] show, "Example config information for wlan0. Uncomment the lines you need and fill in your configuration settings." It appears that you have placed settings in there but forgot to uncomment the lines, do that by taking the hash mark # out from in front of the lines you are using.
<snip>
Thanks Darin; I'm going to re-examine my files more closely in light of your post.
NB - Uncommentinmg these lines has no effect on my problem; under XP, eth0 and wlan0 are both on the same subnet...
Also, I tried asigning getting my router to assign IP address on the basis of NIC MAC address: I assigned .101 to my WiFi NIC, which is fine for XP, but resulted in .104 notbeing obtained under Linux, so no internet connection.
I then reassigned the WiFi NIC under XP to .104 to try and 'free-up' .101 for Linux... no dice!
What on earth is going on with Linux that it insists on obtaining .104?
Changing the third number would change your subnet, not the last one:
192.168.1 vs 192.168.0
Manually shutdown one of the interfaces and restart the second and see if you can access the internet.
Also after doing that, verify that you have a default gateway with the output of the route command.
Check the contents of /etc/resolv.conf. It should contain the DNS address. Both are required to access the internet.
wlan0 Link encap:Ethernet HWaddr 00:90:96:BB:B5:C2
inet addr:192.168.1.104 Bcast:192.168.1.255 Mask:255.255.255.0
...
With both of these interfaces up and on the same subnet, I can guarantee that you won't have internet access, unless you are running a bridge device.
I'm sure that is where your problem lies. If you need both interfaces, then one of them should be on a separate subnet, such as 192.168.0.
/etc/rc.d/rc.inet1.conf
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").
# Config information for eth0:
IPADDR[0]="192.168.1.100"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""
# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""
# Default gateway IP address:
GATEWAY="192.168.1.1"
# Change this to "yes" for debugging output to stdout. Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"
## Example config information for wlan0. Uncomment the lines you need and fill
## in your configuration settings.
# (You probably will not need all of these for your own wireless network):
#IFNAME[4]="wlan0"
#IPADDR[4]="192.168.1.101"
#NETMASK[4]="255.255.255.0"
#USE_DHCP[4]=""
#DHCP_HOSTNAME[4]="icculus-wireless"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
#SCRIPT[4]="/etc/rc.d/ifcfg/ifmetric.sh"
#WLAN_ESSID[4]=sn55ge #BARRIER
#WLAN_MODE[4]=Managed
#WLAN_RATE[4]="54M auto"
#WLAN_CHANNEL[4]="1"
#WLAN_KEY[4]="xxxxxxxxxx" # 10 character 64bit HEX WEP key
#WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=xxxxdc66eaf7e6efd5b5523ae43c7925ff4df2f8b7099495192d44a774fda16" # my WPA-PSK - not working yet!
#WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"
#WLAN_WPAWAIT[4]=30
<snip>
I commented out eth0 and uncommented the relevant lines for wlan0.
My rc.local has a "dhcpcd wlan0" line in it.
However I boot Linux now, I can't get past this "dhcpcd wlan0" line!
If I can access Linux, I'll live with my dhcp woes, but please, how can I access my box now? (I don't have a floppy device.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.