LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 11-07-2005, 01:01 PM   #1
rgbrock1
Member
 
Registered: Sep 2004
Location: Connecticut
Distribution: SUSE 10, Mandriva
Posts: 70

Rep: Reputation: 15
Need different configurations with my Laptop


Hi.

I have an HP laptop which I use both at work and at home. I use a wired connection at work on the LAN and at home I use Wireless connectivity.
The problem seems that when I go from one connection to another I wind up having to change some parameters. For example, if I use the laptop at home, I have to enter the WiFi router I have at home in the "gateway" area of Network card. When I go to work even though I don't have the wireless card on, I have to change the router to the one here at work.
In other words, is there any way for me to have two different network configurations dependant on the card i'm using at the time ie, Wireless or wired?
Thanks.

Richard
 
Old 11-08-2005, 06:52 AM   #2
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
You should be able to write a quick script that handles the settings for wired + wireless networks. I have the same problem so created two scripts in /etc/init.d. When at work, I simply type /etc/init.d/wired start and it shuts down wlan0, configures dhcp for wired card, setups internal DNS servers, etc. When at home, simply /etc/init.d/wireless start and the opposite happens. Have a look at some basic bash scripting tutorials to look at setting up your scriptss it will make it much easier.
 
Old 11-08-2005, 06:56 AM   #3
rgbrock1
Member
 
Registered: Sep 2004
Location: Connecticut
Distribution: SUSE 10, Mandriva
Posts: 70

Original Poster
Rep: Reputation: 15
Thanks Fouldsy for the info. Actually, to make it much, much simpler for me why don't you email me your scripts!!!!! (If you would be so kind!)
Thanks again.
 
Old 11-08-2005, 07:30 AM   #4
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
Wireless script saved to /etc/init.d/wireless:
Code:
#!/bin/bash

case "$1" in
     start)
          depmod -a
          modprobe ndiswrapper

          ifconfig eth0 down
          ifconfig wlan0 down

          iwconfig wlan0 essid "setyours"
          iwconfig wlan0 key restricted [1] setyourkeyhere
          ifconfig wlan0 192.168.1.80 netmask 255.255.255.0

          # Putting in the netmask prevents network activity, dunno why :-)
          # Might just be a quirk of Gentoo, haven't looked to hard at it!
          route add default gw 192.168.1.1

          ifconfig wlan0 up
          ;;
     stop)
          ifconfig wlan0 down
          ;;
esac

exit 0
You could simply put the code into a script rather than working out start + stop, but I like the idea of stopping it for whatever reason. The wired network script is the same, but giving IP details for eth0 and shutting down wlan0. Or, configure your wired network as system default and only call the wireless script at home.
 
Old 11-08-2005, 07:52 AM   #5
rgbrock1
Member
 
Registered: Sep 2004
Location: Connecticut
Distribution: SUSE 10, Mandriva
Posts: 70

Original Poster
Rep: Reputation: 15
Thanks much: i appreciate it.

richard
 
Old 11-08-2005, 08:11 AM   #6
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
No problem, just tweak it for your own settings and come back with any problems. Is pretty straightforward. Would still suggest looking at learning some basic bash scripting for stuff like that - makes life so much easier
 
  


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
dhcpd configurations depam Linux - Software 2 10-07-2005 03:09 PM
kernel configurations jcombs_31 Slackware 2 01-04-2005 08:22 PM
acx100 configurations rabby Linux - Wireless Networking 7 04-28-2004 01:27 PM
Exotic Configurations lectraplayer Linux - Hardware 0 12-03-2003 09:12 PM
Server Configurations jeffpoulsen Linux - General 4 02-12-2003 08:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 06:32 AM.

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