[wplug] Two Subnets?

James O'Kane jo2y at midnightlinux.com
Wed Aug 18 16:01:59 EDT 2004


On Wed, 18 Aug 2004, wplug wrote:

> I guess I'll be showing my ignorance here, I didn't realize one NIC
> could function on two networks (ie two addresses).

It's not too hard actually. You set it up just like you would eth0, except
you configure eth0:1 for example. Sometimes I do eth0:194 if the address
is x.x.x.194. A command line example would be like this:
ifconfig eth0:1 192.168.0.194 netmask 255.255.255.0

> Is this a complicated setup? How would IPTABLES be defined to show two
> instances of one interface with differing addresses?

It's been a while since I've had a configuration like this. I don't
remember if -i eth0:1 is valid or not. It might not depending on where in
the IP stack things are implimented. If that doesn't work, you can do -i
eth0 -d 192.168.0.194 to be specific which IP address you're refering to.


Something I've wondered and I don't think I've seen the answer mentioned
yet. Why are you using this configuration? If it's as simple as you're
using 192.168.0.0/255.255.255.0 on one machine, and
192.168.1.0/255.255.255.0 on the other, the simple solution might be to
use 192.168.0.0/255.255.252.0 which would be the addresses
192.168.0.0-192.168.3.255.

As you've presented the problem, we're limited on what we can suggest as a
good solution.


-james




More information about the wplug mailing list