Re: Two fixed network cards
From: "David Z Maze" <dmaze@debian.org>
> ThanhVu Nguyen <thanhvunguyen@psu.edu> writes:
>
> > I have a slightly different situation, at home my machine has a fixed
> > static address in my local network. But at school it uses dhcp. Both
> > places use wired ethernet so I only deal with 1 eth0 here. So is there
> > a way / or tool that can help me do this task
> ...
> > what I am having now is 2 /etc/network/interface file, one for home ,
> > one for school and I have to change them according to where am I. An
> > automated task would be good.
>
> Note that you can do things by hand but still only have one
> /etc/network/interfaces file:
>
> # cat /etc/network/interfaces
> iface eth0 inet dhcp
> iface net-home inet static
> address 192.168.1.17
> netmask 255.255.255.128
> broadcast 192.168.1.127
> gateway 192.168.1.1
> # ifdown eth0
> # ifup eth0=net-home
And Thomas Hood's ifupdown-roaming will handle this automatically, with a single
interfaces file but, if your only way to tell which net you're on is whether or
not you get an IP served by dhcp, there'll be a 30 second (iirc) delay while it
waits for a response from the server (obviously you can change this value in
your dhcp client). Most of the automatic network detections will look for a
known MAC address, or similar test, to eliminate this delay.
Reply to: