On Tue, 19 Oct 1999 12:48:14 +0100,
Kristian Hoff <[EMAIL PROTECTED]> wrote:
>I have a class C network, and I was wondering if it is
>possible to subnet it into 2 subnets where one of the
>subnets is larger than the other.
>
>Something like this:
>
>195.139.51.0 11000011.10001011.00110011.00000000 (net)
>195.139.51.3 11000011.10001011.00110011.00000011 (broadcast)
>
>255.255.255.252 11111111.11111111.11111111.11111100
>
>195.139.51.4 11000011.10001011.00110011.00000100 (net)
>195.139.51.255 11000011.10001011.00110011.11111111 (broadcast)
>
>255.255.255.004 11111111.11111111.11111111.00000100
>
>Will this work, or do the netmask ALWAYS have to be first 1s and then
>0s?
On any OS that supports CIDR (which is everything these days), the
netmask must be first 1's then 0's. However all is not lost. Since
you have a router between the two subnets, do this
Host 195.139.51.2/30
|
+------------+--------------+
|195.139.51.1/30 interface A|
| router |
|195.139.51.5/24 interface B|
+------------+--------------+
|
Hosts 195.139.51.6-254/24
The router has two overlapping networks but the standard routing
algorithm wil choose the correct subnet. Packets for 195.139.51.0/30
will go via interface A, packets for the rest of 195.139.51.0/24 go via
interface B.
/30 gives you network, broadcast and exactly 2 addresses, one of which
belongs to interface A so you can only have a single host on the /30
network. That single host has a default gateway of interface A,
195.139.51.1.
/24 gives you network, broadcast and 254 hosts but you must not use
addresses 0-3 for interface B nor for any hosts attached to interface
B, they will not be able to route.
There is one more wrinkle, how to make hosts on interface B talk to the
hosts on interface A? As far as the B routing goes, the A addresses
should be on the B network, B hosts will try to talk directly to the A
hosts without going via the router. The answer is proxy ARP. When the
router is configured with proxy ARP, it answers ARP requests on the B
network with the MAC address for interface B, the B hosts send the
packets to the router's B interface, the router sends them to the A
subnet. Fiddly on the router and the A subnet but transparent to all
the B hosts.
You might find ftp://ftp.ocs.com.au/pub/ipcalc.pl.gz useful when
calculating subnets.
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]