Netmasks for aliases (was Re: Bizarre Networking Problem)

2003-02-21 Thread Willie Viljoen
On Friday 21 February 2003 19:17, Mark wrote:
 
  /sbin/ifconfig xl0 192.246.38.10 netmask 255.255.255.0
  /sbin/ifconfig xl0 alias 208.23.240.10 netmask 255.255.255.0

 Hmm, I thought aliases always needed to have netmask of 255.255.255.255.
 Has something changed?

 - Mark

Mark,

Aliases on the same subnet should always be 255.255.255.255, this does not 
apply where they are on different subnets, however. Here is a good example, 
from the ifconfig output of a mail server I set up at an ISP in a nearby 
town. They used to use a private range, but have since added a public class 
C which has been broken up into smaller ranges for routing. 

The mail server, for legacy reasons, still has to serve people on the old 
IPs because those are still being used by machines in their office, and 
reconfiguring every office machine with new server IP addresses (they 
didn't have internal DNS then) would be wasting time. We didn't want to 
waste public IPs on beancounters, so we just left their machines as is. 

The host is also serving on the new IP, and acting as a POP server for 
several virtual domains, which have aliases. The 10.0.1.0/24 range (their 
office), and the 196.38.113.0/27 range (used for their server farm + 
virtual domains) are still the same physical network though. The output 
from ifconfig follows:

%ifconfig
dc0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
inet 196.38.113.2 netmask 0xffe0 broadcast 196.38.113.31
inet6 fe80::a00:8ff:fe00:800%dc0 prefixlen 64 scopeid 0x1
inet 196.38.113.3 netmask 0x broadcast 196.38.113.3
inet 196.38.113.5 netmask 0x broadcast 196.38.113.5
inet 196.38.113.6 netmask 0x broadcast 196.38.113.6
inet 196.38.113.7 netmask 0x broadcast 196.38.113.7
inet 196.38.113.8 netmask 0x broadcast 196.38.113.8
inet 196.38.113.9 netmask 0x broadcast 196.38.113.9
inet 196.38.113.10 netmask 0x broadcast 196.38.113.10
inet 196.38.113.11 netmask 0x broadcast 196.38.113.11
inet 10.0.1.4 netmask 0xff00 broadcast 10.0.1.255
inet 10.0.1.5 netmask 0x broadcast 10.0.1.5
ether 08:00:08:00:08:00
media: Ethernet autoselect (100baseTX full-duplex)
status: active
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff00

Note how 196.38.113.2 (the machine's real address) has a netmask of 
0xffe0, or 255.255.255.224, and the other addresses in this range (all 
of them aliases) have 0x, 255.255.255.255. Then look at 10.0.1.4, 
which is an alias too. It has a netmask of 0xff00, or 255.255.255.0. 
Now look at 10.0.1.5, an alias used for serving intranet web content to 
legacy machines. Again, a netmask of 0x. 

The reason for this is that 10.0.1.4, even though being an alias, is the 
first address the machine handles on that subnet. Just as 196.38.113.2 is 
the first address the machine has on the public subnet.

Rule of thumb: First address on a subnet, alias or not, has the proper 
subnet netmask. Every other address on the subnet following that, has 
0x, or 255.255.255.255.

Will



 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-questions in the body of the message

-- 
Willie Viljoen
Freelance IT Consultant

214 Paul Kruger Avenue, Universitas
Bloemfontein
9321
South Africa

+27 51 522 15 60
+27 51 522 44 36 (after hours)
+27 82 404 03 27 (mobile)

[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Netmasks for aliases (was Re: Bizarre Networking Problem)

2003-02-21 Thread Mark
- Original Message -
From: Willie Viljoen [EMAIL PROTECTED]
To: Mark [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, February 21, 2003 7:24 PM
Subject: Netmasks for aliases (was Re: Bizarre Networking Problem)

 On Friday 21 February 2003 19:17, Mark wrote:

   /sbin/ifconfig xl0 192.246.38.10 netmask 255.255.255.0
   /sbin/ifconfig xl0 alias 208.23.240.10 netmask 255.255.255.0
 
  Hmm, I thought aliases always needed to have netmask of 255.255.255.255.
  Has something changed?
 
  - Mark

 Mark,

 Aliases on the same subnet should always be 255.255.255.255, this does not
 apply where they are on different subnets, however. Here is a good
 example, from the ifconfig output of a mail server I set up at an ISP in a
 nearby town. They used to use a private range, but have since added a
 public class C which has been broken up into smaller ranges for routing.

 The mail server, for legacy reasons, still has to serve people on the old
 IPs because those are still being used by machines in their office, and
 reconfiguring every office machine with new server IP addresses (they
 didn't have internal DNS then) would be wasting time. We didn't want to
 waste public IPs on beancounters, so we just left their machines as is.

 The host is also serving on the new IP, and acting as a POP server for
 several virtual domains, which have aliases. The 10.0.1.0/24 range (their
 office), and the 196.38.113.0/27 range (used for their server farm +
 virtual domains) are still the same physical network though. The output
 from ifconfig follows:

 %ifconfig
 dc0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
 inet 196.38.113.2 netmask 0xffe0 broadcast 196.38.113.31
 inet6 fe80::a00:8ff:fe00:800%dc0 prefixlen 64 scopeid 0x1
 inet 196.38.113.3 netmask 0x broadcast 196.38.113.3
 inet 196.38.113.5 netmask 0x broadcast 196.38.113.5
 inet 196.38.113.6 netmask 0x broadcast 196.38.113.6
 inet 196.38.113.7 netmask 0x broadcast 196.38.113.7
 inet 196.38.113.8 netmask 0x broadcast 196.38.113.8
 inet 196.38.113.9 netmask 0x broadcast 196.38.113.9
 inet 196.38.113.10 netmask 0x broadcast 196.38.113.10
 inet 196.38.113.11 netmask 0x broadcast 196.38.113.11
 inet 10.0.1.4 netmask 0xff00 broadcast 10.0.1.255
 inet 10.0.1.5 netmask 0x broadcast 10.0.1.5
 ether 08:00:08:00:08:00
 media: Ethernet autoselect (100baseTX full-duplex)
 status: active
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 16384
 inet6 ::1 prefixlen 128
 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
 inet 127.0.0.1 netmask 0xff00

 Note how 196.38.113.2 (the machine's real address) has a netmask of
 0xffe0, or 255.255.255.224, and the other addresses in this range (all
 of them aliases) have 0x, 255.255.255.255. Then look at 10.0.1.4,
 which is an alias too. It has a netmask of 0xff00, or 255.255.255.0.
 Now look at 10.0.1.5, an alias used for serving intranet web content to
 legacy machines. Again, a netmask of 0x.

 The reason for this is that 10.0.1.4, even though being an alias, is the
 first address the machine handles on that subnet. Just as 196.38.113.2 is
 the first address the machine has on the public subnet.

 Rule of thumb: First address on a subnet, alias or not, has the proper
 subnet netmask. Every other address on the subnet following that, has
 0x, or 255.255.255.255.

 Will


Thanks for clarifying this, Will. :) That was a very lucid and helpful
explanation.

- Mark


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message