By The Way - kernel 2.6.12 is finally out and I hope I can switch back to gentoo sources soon to have the nice boot screen and fb-tng again. Do you know whether the "Swich from X to console" mass with fb-tng is gone?


This is a routing problem mostly due to /etc/resolv.conf being overwritten each time a network interface is activated. Mind also DHCP options that give the default gateway and the name server addresses. Basically only one adapter should be active if both receive their address from a DHCP. Otherwise at least one of them should prevent resolv.conf from being overwritten. This is accomplished with dhcpcd -R argument, for instance.RBJ1128 wrote:Does anyone know what would cause the computer to not be able to connect to the internet while eth0 (wired) and eth1 (wireless) are both active? If I disable one of them then I have full connectivity, but with both of them enabled I cannot get anything.
Thanks. Right now I cannot ssh into my laptop and I am at work so I can't make any of the changes right now. Is there anywhere in specific that I should look online to find out what DHCP options to use??VinzC wrote: This is a routing problem mostly due to /etc/resolv.conf being overwritten each time a network interface is activated. Mind also DHCP options that give the default gateway and the name server addresses. Basically only one adapter should be active if both receive their address from a DHCP. Otherwise at least one of them should prevent resolv.conf from being overwritten. This is accomplished with dhcpcd -R argument, for instance.
I've looked at dhcpcd man pages. Look also into /etc/wireless.sample. You have to decide which ethernet adapter will be master.RBJ1128 wrote:Is there anywhere in specific that I should look online to find out what DHCP options to use??
Well, I am going to want my wired (eth0) to be master, but I don't want to have to make a bunch of changes just to switch over to my wireless (eth1). I've looked at the /etc/conf.d/wireless.sample file, but I'm not sure what to set. In the past I just had a very simple script - it set the ssid and key for eth1, and restarted both of the services. I did this so that when I boot without a wire I don't have to wait for it to timeout. Aside from the ssid and the key settings, I don't know what to change for my eth1 interface.VinzC wrote: I've looked at dhcpcd man pages. Look also into /etc/wireless.sample. You have to decide which ethernet adapter will be master.
For instance, I use only WiFi at home but wired ethernet at work. In /etc/conf.d/wireless I setup dhcpcd not to overwrite resolv.conf when connected to the wireless at work (dhcpcd_eth1="-R -N"). When at home the default parameters are used (i.e. dhcpcd, overwrite resolv.conf and ntp.conf). When I'm at work I still have to stop the WiFi so that I can use the wired LAN but I can live with it.
You can have the WLAN card automatically connect to only prefered WiFi networks: remove the corresponding SSID from variable preferred_aps in /etc/conf.d/wireless. Then set associate_order to preferredonly and you should be done. You can optionnally use ifplugd to bring up/down eth0 when needed.
This is what I have in my conf.d/net:VinzC wrote:The whole bunch only consists of a few lines in /etc/conf.d/net and /etc/conf.d/wireless. If you use DHCP, then both files may be empty as the default config is used: use machine host name with DHCP. If you use DHCP for both the wireless and the wired LAN, the only thing you need to have is in /etc/conf.d/wireless and the stuff I mentionned earlier. You might also have to define your WEP keys.
Thanks. I'll try that after work today as if I make the changes via SSH, when I bring up the wireless connection I will be cut off instantly.VinzC wrote:I see from your net configuration the file may be just blank as it contains the default settings. As for the encryption key it is hex unless s: specified, in which case it's the string representation. I have put the hex value in uppercase, without the s: prefix.
EDIT: you should also remove the enc open keywords.
I've tried and it works at least for me. The only thing is about ntp. When ntp services run wlan has not started yet. But I think the workaround is to control ntp from a post_up() function in conf.d/net.RBJ1128 wrote:Thanks. I'll try that after work today as if I make the changes via SSH, when I bring up the wireless connection I will be cut off instantly.VinzC wrote:I see from your net configuration the file may be just blank as it contains the default settings. As for the encryption key it is hex unless s: specified, in which case it's the string representation. I have put the hex value in uppercase, without the s: prefix.
EDIT: you should also remove the enc open keywords.
I tried that, but my wireless network didn't like it. In my apartment complex there are MANY wireless networks, and about 25% of them are unsecured, so I get connected to them. I did, however, manage to install ifplugd, and modify the "/usr/sbin/ifplugd.action" file. I added a line in there to call one of my scripts. In my script I have a call to "ifplugstatus | grep eth0" and I compare that string to "eth0: unplugged". If they match, then my wireless connection gets brought up with 3 commands:VinzC wrote: I've tried and it works at least for me. The only thing is about ntp. When ntp services run wlan has not started yet. But I think the workaround is to control ntp from a post_up() function in conf.d/net.
I've had that too until I upgraded baselayout. But it was long ago. Now the current version doesn't require anymore to manually pass the network key. However that job should be done automatically if you've put the ESSID and WEP key into /etc/conf.d/wireless. I wonder why it's different on your machine...RBJ1128 wrote:... If they match, then my wireless connection gets brought up with 3 commands:
iwconfig eth1 essid XXXXXXX
iwconfig eth1 key XXXXXXXXXXXXXXXXXXXXXXXXXX
/etc/init.d/net.eth1 start
How did you manage to get both interfaces mutually exclusive? I haven't quite understood. Would you mind also posting your ifplugd config file? Until now I could not have ifplugd sense the network carrier correctly. It's either on or off from the start. I can plug the network cable after the machine has booted but the interface remains off.RBJ1128 wrote:If the two strings don't match then my wireless gets shut down. I had to play around with the "/etc/conf.d/ifplugd" file to have it monitor my wired connection for changes, but as of right now, if I unplug my wired connection, my wireless picks up instantly. I have not yet gotten it to work where my wired connection picks up when a cable is plpugged in, but I am working on that. Maybe this will help someone else.
Sure thing, here is the file, with some comments taken out:VinzC wrote: How did you manage to get both interfaces mutually exclusive? I haven't quite understood. Would you mind also posting your ifplugd config file? Until now I could not have ifplugd sense the network carrier correctly. It's either on or off from the start. I can plug the network cable after the machine has booted but the interface remains off.
Code: Select all
...
# ifplugd configuration file
INTERFACES="eth0"
# Additional parameters for ifplugd.
# See manual page ifplugd.8 for details.
# If you set AUTO to yes, you have to read http://bugs.gentoo.org/show_bug.cgi?id=28362
# I recommend a delay of 0, both ways, since then, you can swap ethernet
# cables on different networks and get a new ip address.
# None of the programs I tested had a problem with the interface being
# gone in the mean time.
AUTO="no"
BEEP="yes"
IGNORE_FAIL="yes"
IGNORE_FAIL_POSITIVE="no"
IGNORE_RETVAL="yes"
POLL_TIME="1"
DELAY_UP="3"
DELAY_DOWN="0"
API_MODE="auto"
SHUTDOWN="no"
WAIT_ON_FORK="no"
MONITOR="yes"
ARGS=""
Code: Select all
#!/bin/sh
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/ifplugd/files/gentoo-ifplugd.action-v2,v 1.3 2004/07/15 00:43:53 agriffis Exp $
#
# Gentoo-specific ifplugd.action
#
# This file gets called by ifplugd when it wants to bring an interface
# up or down.
#
case "$2" in
up)
state=restart
;;
down)
state=stop
;;
*)
echo "$0: wrong arguments"
echo "Call with <interface> <up|down>"
exit 1
;;
esac
if [ -x /etc/init.d/net.$1 ]
then
/etc/init.d/net.$1 --quiet $state
/scripts/network.sh
exit 0
else
logger -t ifplugd.action "Error: Couldn't configure $1, no /etc/init.d/net.$1 script!"
exit 1
fi
Code: Select all
#!/bin/bash
ETH0_STATE="$(ifplugstatus | grep eth0)"
echo "$ETH0_STATE"
if [ "$ETH0_STATE" == "eth0: unplugged" ];
then
iwconfig eth1 ESSID XXXXXXX
iwconfig eth1 key XXXXXXXXXXXXXXXXXXXXXXXXXX
/etc/init.d/net.eth1 start
echo 1 >> /sys/bus/pci/drivers/ipw2200/0000:03:03.0/led
else
/etc/init.d/net.eth1 stop
fi
If there is one thing that I have learned about Linux it is that if I cannot find a program to do what I want, then write my own... I tried the settings in /etc/conf.d/wireless but my wireless card would still connect to any wireless network available. I was unable to get it to connect to my network. I think that I will just stick with my custom script - I know that works!VinzC wrote:@RBJ1128:
Ah, custom scripts! I see now. After all, that's Linux. Thanks for the config. I think I've missed MONITOR="yes"
... I think I'll take a look to ifplugd action script.
As for WiFi here's what I've learnt:These steps won't normally require you to manually run iwconfig. Controlling wlan is achieved with the net.eth1 init script. So the only script you might have to use would be ifplugd.action. Just put /etc/init.d/net.eth1 <action> and that should do the trick.
- ipw2200 can be loaded at boot by coldplug; doesn't need to be blacklisted
- set associate_order to "preferredonly" to autoconnect only to preferred AP's
- exclude an ESSID from preferred_aps to prevent autoconnect to that AP
- put encryted key and ESSID as appropriate to allow auto connection; put the corresponding ESSID in preferred_aps too to auto connect
EDIT: And I forgot... Put the WiFi led on in the postup() function that you put into conf.d/net. I will my config file whenever requested as soon as I get to my laptop.
Try preferred_aps_eth1 for I know I had to use that form. I would say if it doesn't work for you then there might be a problem somewhere in the config files and/or with packages that do not fit together. There's no obvious reason why the same configuration should work on a given machine and not an another machine when both are the same hardware. This is true for WindozeRBJ1128 wrote:...
I tried the settings in /etc/conf.d/wireless but my wireless card would still connect to any wireless network available. I was unable to get it to connect to my network. I think that I will just stick with my custom script - I know that works!
Yeah, but I'll just stick with my custom script, I know that one works.VinzC wrote: Try preferred_aps_eth1 for I know I had to use that form. I would say if it doesn't work for you then there might be a problem somewhere in the config files and/or with packages that do not fit together. There's no obvious reason why the same configuration should work on a given machine and not an another machine when both are the same hardware. This is true for Windozebut not for Linux, from my own experience.
i have my system suspending to disk as wellacidbrain wrote:
UPDATE:
Just got suspend 2 disk working.
I installed swsusp2 with the howto from the gentoo-wiki
I played around with /etc/hibernate/hibernate.conf and I had to comment outin xorg.confCode: Select all
Load "dri"
In /etc/acpi/default.sh I changedtoCode: Select all
power) /sbin/init 0Now my system suspends when I push the power button.Code: Select all
power) hibernate &
Code: Select all
sleep) /usr/sbin/hibernate
;;
Code: Select all
hibernate) /usr/sbin/hibernate
;;