Re: Different network environments
This would be almost trivial to write as a bash script.
i.e.
#!/bin/bash
/etc/sysconfig/network-scripts
if [ "$1" -eq "DHCP" ]; then
ifup ifcfg-eth0.dhcp
elsif [ "$1" -eq "STATIC1" ]; then
ifup ifcfg-eth0.static1
#etc...for more connection
fi
Then put files of following form in /etc/sysconfig/network-scripts...
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
You can look at /etc/init.d/network to see how this starts by
itseld. Let me know if you need more help.
On Thu, 3 Apr 2003, Harry Brueckner wrote:
> Hi there,
>
> I am looking for a way to manage different network configurations for
> environments I am working in with my notebook (Woody unstable). Sometimes I
> have to use DHCP, sometimes its a static IP and so on.
>
> I tried to find something using 'apt-cache search' but for all keywords I
> get so many hits that its somewhat complex.
>
> Any suggestions?
>
> TIA,
> Harry
>
>
>
--
---------------------------------------------
Loren A. Linden Levy
481 Loomis, Department of Physics
University of Illinois at Urbana-Champaign
1110 W. Green St., Urbana, IL 61801-3080
Tel: 217-244-7995 Fax: 217-333-1215
Email: lindenle@uiuc.edu
url: http://w3.physics.uiuc.edu/~lindenle/
---------------------------------------------
"But I'm sure that you'd learn mathematics
faster than I'd learn baseball."
--Albert Einstein
When Red Sox catcher Moe Berg offered to
teach baseball in exchange for math tutoring.
Reply to: