Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Different network configs based on physical card?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
carl
n00b
n00b


Joined: 12 Mar 2003
Posts: 30
Location: Michigan, USA

PostPosted: Mon Mar 31, 2003 4:29 pm    Post subject: Different network configs based on physical card? Reply with quote

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
View user's profile Send private message
carl
n00b
n00b


Joined: 12 Mar 2003
Posts: 30
Location: Michigan, USA

PostPosted: Wed Apr 02, 2003 4:12 am    Post subject: Reply with quote

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
View user's profile Send private message
mikki
n00b
n00b


Joined: 14 Jul 2002
Posts: 51
Location: On Top

PostPosted: Wed Apr 02, 2003 2:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
caffiend
n00b
n00b


Joined: 26 Mar 2003
Posts: 48
Location: Oakland, CA

PostPosted: Wed Apr 02, 2003 5:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
carl
n00b
n00b


Joined: 12 Mar 2003
Posts: 30
Location: Michigan, USA

PostPosted: Wed Apr 02, 2003 6:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
caffiend
n00b
n00b


Joined: 26 Mar 2003
Posts: 48
Location: Oakland, CA

PostPosted: Wed Apr 02, 2003 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
carl
n00b
n00b


Joined: 12 Mar 2003
Posts: 30
Location: Michigan, USA

PostPosted: Wed Apr 02, 2003 9:06 pm    Post subject: Reply with quote

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. :P

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
View user's profile Send private message
caffiend
n00b
n00b


Joined: 26 Mar 2003
Posts: 48
Location: Oakland, CA

PostPosted: Wed Apr 02, 2003 9:26 pm    Post subject: Reply with quote

*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
Code:
case "$ADDRESS" in

but before
Code:
*,*,*,*)


that should work, if not try sticking it at the end of the file
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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