LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2007, 07:45 AM   #1
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 921

Rep: Reputation: 46
Post auto configuring network


Ladies & Gentlemen

I have been trying to get my network cards to auto configure. I started out with the idea to background the proccess durring boot because when a cable is not pluged in or I am not in range of my home wireless it takes forever to boot. I know that Knoppix backgrounds these proccess durring their boot sequence. I was looking into how they did that when I came accorss "ifplugd" and "whereami".

I have been following this how-to:
http://www.howtoforge.com/whereami_i...fi_debian_etch

The first snag I ran into was with ifplugd. I installed via kpackage and so I didn't get asked the questions about which interfaces I wanted watched by ifplugd. I did run
Code:
 dpkg -reconfigure ifplugd
and puzzled my way through. It accurs to me that I did set it to watch my wireless, and maybe that is something I should not have done. The relevent lines in etc/default/ifplugd
Code:
INTERFACES="eth0 eth1"
HOTPLUG_INTERFACES="eth2"
I believe eth0 refers to my firewire, eth1 to my ethernet. My wireless is reproted by all my gui network apps as being eth2. It seams to me that there should be a comma or semicolen or something between the different interfaces yet I don't have one there. I have not hand edited this file, it is the result of "reconfigure ifplugd" so I have assumed that it is correct and not inserted a comma.

I have finally gotten back to this after several days so things are not fresh in my mind as to just what I did, so please excuse my vagueness.

The next thing I did was try to configure whereami. The author of the how-to did not relate to the issue of having three network interfaces, and so I made my best guess as to how to configure whereami. I am sure that I have the config file all messed up.

I have pointed whereami to what I beleave are the correct interfaces yet on boot it is obvieous that it is not working as my boot times are far worse than they were before. It is checking interfaces twice I think. I can tell ifplugd is not working because it is still serchig for ip's and now I have to manually restart my wireless after boot to have access.

Part of the config file below is from the oridignal and part is from me trying to set it up per the how-to. I have tryed to # comment the changes I have made. Hear are the parts I think are relevent.

Code:
etc/whereami/detect.conf
# It is a good idea to default to somewhere...
default undocked

# Test for the presence of an ethernet connection plugged into eth0
# I believe this is a firewire port.
testmii eth0 lan

# Added this line
# Test for the presence of an ethernet connection plugged into eth1
testmii eth1 lan2

# Added this line.
# Get a list of the access points that we can see
testap      eth2,scan    wlan

# 'down' might be a location that is forced from the command line
# like "whereami down"
if down
  always at undocked
  always notat eth0,eth1,eth2 
elif stop
  # Or maybe we can't remember the exact command, so we do it twice!
  # like "whereami stop" this time
  always at undocked
  always notat eth0,eth1,eth2
elif lan
  # If the testmii at the top was successful
  set INTERFACE eth0
   testdhcp    '*.*.*.*'    dhcp  # uncomented this line
  # testarp     eth0,00:24:5e:17:12:11,10.2.0.4  morrinsville
  # testping    192.168.138.1,192.168.138.55     queenstown
  # testping    202.49.41.18,202.49.41.1         rotorua
elif lan2
  # Added this elif 
  # If the testmii at the top was successful
  set INTERFACE eth1
   testdhcp    '*.*.*.*'    dhcp  # uncommented this line
  # testarp     eth0,00:24:5e:17:12:11,10.2.0.4  morrinsville
  # testping    192.168.138.1,192.168.138.55     queenstown
  # testping    202.49.41.18,202.49.41.1         rotorua
#else wlan # commented out
  # Added this else 
  # If the testmii at the top was successful
  #set INTERFACE eth2
  # testdhcp    '*.*.*.*'    dhcp  # uncommented this line
  # testarp     eth0,00:24:5e:17:12:11,10.2.0.4  morrinsville
  # testping    192.168.138.1,192.168.138.55     queenstown
  # testping    202.49.41.18,202.49.41.1         rotorua
#else
  # If the testmii at the top failed
  # modprobe prism54 w_eth1
  # always modprobe orinoco w_eth1
  # always modprobe ath_pci atheros
  # always modprobe ipw2100 w_eth1
  # ... and we unload this in whereami.conf, if we don't find one,
  # in an attempt to minimise power, and RFI
fi

#if w_eth2   # changed to eth2 then commented out
  # Some wireless drivers use one interface name
  #set INTERFACE eth2
  #testap scan wlan
#fi

#if atheros # commented out
  # And some use a different one
  #set INTERFACE ath0
  #testap scan wlan
#fi

# If we have found at least some WLAN APs in the vicinity, find out
# if we can do anything with any of them
#if wlan
  # # If there's anything there at all, try and DHCP off it
  # testap      .+                  wdhcp
  # # And if there isn't, we will indicate that.
  # notat  wlan,wdhcp
#fi

# So it seems we should try and get DHCP off a WLAN AP
#if wdhcp
  # testdhcp    '*.*.*.*'    dhcp
#fi

# And if we have DHCP (wired or wireless) we want to make
# a decision as to which LAN that is, exactly.
if dhcp
   testdhcp    192.168.0.*     home
   testdhcp    192.168.1.*     access point
fi
I realize that alot of this is not needed in my final version and should be removed. Looking at this now I am sure that it is falling all the way through somehow but it is too much for my feable mind to get around.

I have never had anything hooked to the firewire on this laptop. I suppose I should relate that I am running Debian Lenny amd64 x2 2.6.21 kernel

The other config file which seams to me to be much less complex and so not so messed up is eth/whereami/whereami.conf

Code:
# By default we assume that the detection configured routing
=any GATEWAY=""
# By default we assume we have an unfiltered internet connection
=any PROXY="none"
=any NTPDAEMON=/etc/init.d/ntp-server
=any NTPSERVER=ntp

## This only happens if we are not at a WLAN
!wlan ifconfig eth2 down # changed from wlan0 to eth2
!wlan resolvconf -d eth2

## This only happens if we are not at a LAN
!lan ifconfig eth0 down
!lan resolvconf -d eth0

## This only happens if we are not at a LAN2 # Added this section
!lan ifconfig eth1 down
!lan resolvconf -d eth1

## Added this section
## Setup wlan connections
!wlan if /bin/false; then
=any iwconfig eth2 mode managed
=any ifconfig eth2 up

## Added this section
## Get IP from dhcp
=any dhclient eth2
!wlan fi
Thanks for your insite and assistance

Shalom
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with configuring auto script badall Linux - Networking 4 06-17-2007 09:15 AM
Auto connect in different wireless network Juan Basso Linux - Wireless Networking 2 09-25-2006 05:16 PM
Auto-configuring PCMCIA NIC doesn't work on bootup Malibyte Debian 1 12-11-2005 09:19 PM
Auto-mount a network drive agarnier Linux - Networking 4 10-29-2003 08:09 AM
Network auto start override Stephanie Linux - General 7 07-27-2001 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration