On Sun, 2004-08-22 at 18:36, John Floren wrote:
[...]
Could I use something like this?
--- /etc/network/interfaces ---
auto lo eth0
iface lo inet loopback
iface lan inet static
address 192.168.0.123
netmask 255.255.255.0
iface wan inet dhcp
--- EOF ---
No. Where is eth0? You have it as an automatic interface, but there is
no entry for it. Change "lan" to "eth0". I don't know about your
"iface wan", but I'm not sure that would work either. Unless I am
greatly mistaken, arguments for iface must be actual interface names.
Let me quote a bit more of the Debian reference where I found this:
<quote>
However, suppose your computer is a laptop that you transport between
home and work. When you connect the computer to the corporate network or
to your home LAN you need to configure eth0 accordingly.
First define two logical interfaces home and work (instead of eth0 as we
did earlier) which describe how the interface should be configured for
the home network and the work network, respectively.
iface home inet static
address 192.168.0.123
netmask 255.255.255.0
gateway 192.168.0.1
iface work inet static
address 81.201.3.123
netmask 255.255.0.0
gateway 81.201.1.1
Then physical interface eth0 can be brought up for the home network with
the appropriate configuration by specifying it on the command line:
# ifup eth0=home
To reconfigure eth0 for the work network issue the commands:
# ifdown eth0
# ifup eth0=work
Note that with the interfaces file written as above it will no longer be
possible to bring up eth0 by doing ifup eth0 alone. The reason is that
ifup uses the physical interface name as the default logical interface
name and now in our example no eth0 logical interface is defined.
</quote>
I simply replaced 'work' and 'home' by 'wan' and 'lan' respectively,
assuming the actual name wouldn't make a difference.
[...]