[plug] Suse 9.2 2 nics

Craig Ringer craig at postnewspapers.com.au
Fri Jun 24 23:45:03 WST 2005


On Fri, 2005-06-24 at 18:53 +0800, Bernd Felsche wrote:

> If you want it to work "like a switch" with only one computer
> connected to at least one of the nics, then create a smaller subnet
> for that nic.

IMO if you want it to work like a switch, just bridge the interfaces.
Much cleaner.

> e.g. change eth1 to 192.168.1.1 netmask 255.255.255.254

That netmask specifies a 31 bit subnetwork. That's not a legal network,
because you must have a network address and broadcast address. It might
work, but it might not too - just what we all love in our networks - and
it's generally just a really bad idea. Use at minimum 255.255.255.252
(ie a 30 bit subnet mask).

This RFC:
http://www.faqs.org/rfcs/rfc3021.html
might be interesting, as though it doesn't specify the limitation
(that's built in to the IP protocol) it does give some info on it.

> and then
> change e.g. tears to 192.168.1.0 netmask 255.255.255.254

You've just assigned the network address to tears. That's likely to end
in "tears". Instead, if you really must use compact subnets, consider
using:

192.168.1.0     - network address
192.168.1.1     - router (sweat eth0)
192.168.1.2     - host (tears)
192.168.1.3     - broadcast address
255.255.255.252 - subnet mask

for one subnetwork, and:

192.168.1.4     - network address
192.168.1.5     - router (sweat eth1)
192.168.1.6     - host (blood)
192.168.1.7     - broadcast address
255.255.255.252 - subnet mask

for the second subnetwork.

I still think bridging them is a much better idea.

> with its
> gateway set to 192.168.1.1. Set IP-forwarding on sweat. It will then
> act as a router between interfaces.

Yep. You can just use whole 24 bit subnets of 192.168.0.0/16 though, and
that's likely to be much less confusing to folks relatively new to IP.
As you can see, funny business with subnets is easy to get wrong - but
most people "know" the 192.168.x.0/24 subnets even if they don't
actually understand why they work out that way.

--
Craig Ringer




More information about the plug mailing list