[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Two fixed network cards

My laptop has two fixed (e.g., not PCMCIA) network cards, one wired
and one wireless (802.11a/b combo).  Both are set up by default to use
DHCP in /etc/network/interfaces, and right now the wired card comes up
first.  I'd like to not wait to a DHCP timeout if I don't need to.  I
also know the question "is there an Ethernet cable connected" can be
asked, though not how.  Also, I don't want both the wired and wireless
up the vast majority of the time.

So, what I'd like is to have my network startup work something like

  if eth0.have_ethernet_cable():
  if not eth0.has_address():

(So, don't try to bring the wired interface up if there's not a
connection, and don't try to bring the wireless up if we successfully
brought the wired interface up.)

Any hints on how to do this?  (Besides writing ifupdown-python?  :-)

David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell

Reply to: