You are not logged in.

#1 2009-05-07 14:07:57

jcerdan
Member
From: Andorra
Registered: 2005-12-17
Posts: 53
Website

netcfg & net-auto how to combine them to automatize everything ?

Well,

I have a little "problem" I would like to resolve but I don't really know how:

I have a laptop with wired and wireless network possibilities.
This laptop moves from home to work, and from work to home, everyday.

- At home, I connect to the network using ath0 (madwifi wireless)
- At work, I connect to the network using eth0

(I attach my rc.conf at the end for net-profiles and daemons arrays)
Both are well configured, and there's no problem connecting to any of the networks, but what I would like to do is the following:

- When I'm at home, eth0 should detect there's no cable and should bypass the dhcp 4 seconds wait, then only ath0 should work.
- When I'm at work, ath0 should detect that there's no wireless matching any profile and should then put down ath0 (ifconfig ath0 down), then only eth0 should work.

What's happening now with my config:

- At home, I have to wait at boot 4/5 seconds for a dhcp on eth0. That should be solved with ifplugd, but I would like to know if it's possible to solve this with netcfg, without installing ifplugd.
- Ath work, when no matching profile is found for any wireless network detected, ath0 should go down (ifconfig ath0 down), so only eth0 is alive. Now, ath0 does not go down. (see it with ifconfig)

Is there a possibility to automatize this behaviour with netcfg or easily with other programs?

Here's my rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="es_ES.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="Europe/Andorra"
KEYMAP="es"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(fuse applesmc acpi_cpufreq cpufreq_powersave vboxdrv vboxdrv tun)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="mercure"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
# 
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
eth0="dhcp"
INTERFACES=(!eth0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
 
# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
NETWORKS=(tecob certes)
AUTO_NETWORKS=(auto-wireless ath0)


# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng !network crond net-profiles net-auto hal fam @netfs @avahi-daemon pommed acpid sshd @cups @alsa cpufreq sensors)

Last edited by jcerdan (2009-05-07 14:10:03)

Offline

#2 2009-05-08 15:14:24

rzodkiewka
Member
Registered: 2009-04-19
Posts: 41

Re: netcfg & net-auto how to combine them to automatize everything ?

For the first problem - just add @:

DAEMONS=(... @net-profiles @net-auto ...)

Then you don't need to wait for it and boot faster.

Offline

Board footer

Powered by FluxBB