View previous topic :: View next topic |
Author |
Message |
carl n00b
Joined: 12 Mar 2003 Posts: 30 Location: Michigan, USA
|
Posted: Mon Mar 31, 2003 4:29 pm Post subject: Different network configs based on physical card? |
|
|
Since this is more networking than laptops, I thought I'd post it here.
I'd like to be able to set different networking "profiles" automatically, based on the card that's in the PCMCIA slot at bootup.
At work, I use my Xircom card, and have to have a static IP (it's dumb--the rest of the university is DHCP). At home and my girlfriend's house, I use my Orinoco Gold wireless card, and it's all dynamic.
Is there a way (and this is stretching it, I know) for the system to look at the card (perhaps based on what module is loaded) and choose a networking profile based on that card? That way, I don't have to log in as root, go in and edit my conf.d/net file, restart certain services, and then log back in as my normal user.
Any thoughts? |
|
Back to top |
|
|
carl n00b
Joined: 12 Mar 2003 Posts: 30 Location: Michigan, USA
|
Posted: Wed Apr 02, 2003 4:12 am Post subject: |
|
|
Here's a quick bump to see if anyone has any ideas.
Feel free to offer other suggestions that may not be precisely what I'm after. |
|
Back to top |
|
|
mikki n00b
Joined: 14 Jul 2002 Posts: 51 Location: On Top
|
Posted: Wed Apr 02, 2003 2:23 pm Post subject: |
|
|
You should be able to do this with hotplug scripts, assuming that the wifi and hardline configs are always the same in whatever environments they are in (ie that you don't have multiple different wireless or wired configs), or that the scripts could figure it out (or prompt you?).
I haven't tried this, but you asked for "any ideas". On April Fool's Day, no less. ^_^ _________________ Mikki |
|
Back to top |
|
|
caffiend n00b
Joined: 26 Mar 2003 Posts: 48 Location: Oakland, CA
|
Posted: Wed Apr 02, 2003 5:14 pm Post subject: |
|
|
The specifics escape me, but I'm pretty sure that you can do that with the pcmcia config files. PCMCIA looks up the MAC address of the card and then configures it correctly.
Poke around in /etc/pcmcia/{network,wireless} files to see if that makes sense. |
|
Back to top |
|
|
carl n00b
Joined: 12 Mar 2003 Posts: 30 Location: Michigan, USA
|
Posted: Wed Apr 02, 2003 6:13 pm Post subject: |
|
|
Those are both excellent ideas.
Too bad I don't have the knowledge to put them to work.
Thanks nonetheless...I'll keep poking around! |
|
Back to top |
|
|
caffiend n00b
Joined: 26 Mar 2003 Posts: 48 Location: Oakland, CA
|
Posted: Wed Apr 02, 2003 8:20 pm Post subject: |
|
|
Code: | Too bad I don't have the knowledge to put them to work. |
geez man, dig a little... I don't have pcmcia installed right now or I could give you some more info
but in network.opts I think you'll see sections that start off with wildcarded MAC addresses, just make a new section with your cards MAC address and put the static ip in there.
Restart the service and insert the card, should work fine. Since your wireless card was ok to begin with, just leave that one alone. |
|
Back to top |
|
|
carl n00b
Joined: 12 Mar 2003 Posts: 30 Location: Michigan, USA
|
Posted: Wed Apr 02, 2003 9:06 pm Post subject: |
|
|
caffiend wrote: | Code: | Too bad I don't have the knowledge to put them to work. |
geez man, dig a little... I don't have pcmcia installed right now or I could give you some more info
but in network.opts I think you'll see sections that start off with wildcarded MAC addresses, just make a new section with your cards MAC address and put the static ip in there.
Restart the service and insert the card, should work fine. Since your wireless card was ok to begin with, just leave that one alone. |
If you'd read a bit further in my post, I did indeed say "I'll keep poking around"...thus, I'll keep looking in the config files to see what I can find.
I didn't see any MAC address stuff in that file, but I'll look in other files and see what I can find. Thanks. |
|
Back to top |
|
|
caffiend n00b
Joined: 26 Mar 2003 Posts: 48 Location: Oakland, CA
|
Posted: Wed Apr 02, 2003 9:26 pm Post subject: |
|
|
*sigh* yes you're right, I'm just confused and distracted :)
ok...
we have /etc/pcmcia/network.opts
I was only partially right...
Code: | case "$ADDRESS" in
*,*,*,*)
INFO="Sample private network setup"
# Transceiver selection, for some cards -- see 'man ifport'
IF_PORT=""
# Use BOOTP (via /sbin/bootpc, or /sbin/pump)? [y/n]
BOOTP="n"
# Use DHCP (via /sbin/dhcpcd, /sbin/dhclient, or /sbin/pump)? [y/n]
DHCP="n"
# If you need to explicitly specify a hostname for DHCP requests
DHCP_HOSTNAME=""
|
add
Code: | *,*,*,<MAC address>)
IPADDR=""
NETMASK="255.255.255.0"
NETWORK="10.0.1.0"
BROADCAST="10.0.1.255"
# Gateway address for static routing
GATEWAY="10.0.1.1"
DOMAIN=""
SEARCH=""
DNS_1=""
DNS_2=""
DNS_3=""
;; |
after
but before
that should work, if not try sticking it at the end of the file |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|