From owner-freebsd-hackers Sun Aug 11 23:21:17 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA03279 for hackers-outgoing; Sun, 11 Aug 1996 23:21:17 -0700 (PDT) Received: from scooter.quickweb.com (scooter.quickweb.com [199.212.134.8]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id XAA03274 for ; Sun, 11 Aug 1996 23:21:14 -0700 (PDT) Received: from localhost (mark@localhost) by scooter.quickweb.com (8.6.12/8.6.12) with SMTP id CAA00738 for ; Mon, 12 Aug 1996 02:20:10 -0400 Date: Mon, 12 Aug 1996 02:20:10 -0400 (EDT) From: Mark Mayo To: freebsd-hackers@freebsd.org Subject: ifconfig alias with subnet.. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi all, I seem to be having some problems with aliasing 'extra' IP numbers to a single interface (ep0). I think I'm correct in assuming that once I have the first address added to the machine (the non alias - ifconfig ep0 inet 199.212.134.8 netmask 255.255.255.0) that when I add other addresses, the rule is this: If the address is on the same Class C I alis with netmask of 0xffffffff. But if alias with a netmask of 0xffffff00 if it's on a different Class C. My questions is what happens when you are on a net that is subnetted? In my case, I bring the interface up with : root# ifconfig ep0 inet 199.212.134.8 netmask 255.255.255.240 Since the netmask is 240, I want to add the following two subnets: 199.212.134.80 206.248.60.80 For the 199.212.134.80 'group of 16' I just did this: root# ifconfig ep0 alias 199.212.134.81 .. 82 .. 83 .. etc. And I got the file exists error, but things still seems to work. I was concerned, but heh: if it works don't touch it,, no? --> YES Cause now when I tried to add to add the 206.248.60.80 sub, it didn't work. So I tried doing this: root# ifconfig ep0 alias 206.248.60.81 netmask 0xfffffff0 And voila, the .240 netmask worked, I got the .81 number up == but that's all!!! I can only add the first number from this subnet successfully, the rest just won't work - they go on with a file exists error, and the ping gives me ret -1, host is down. So all in all, I'm confused, and I guess I just want to know how to correctly go about aliasing IPs on a subnetted network. I can send along the results of my netstat -in and netstat -rn directly to anyone who thinks thinks they can figure this out.. The results do seem rather odd, which also makes be ask, how do you know which interface link#2 is?? I assumed it was the second available interface, which seems odd cause I've only got one card! But I've convinced myself that link#1 MUST be the loopback.. is this correct or do I have something fundamentally wrong inside this machines config?? Thanks for any help, hopfully I have a little hair left by the time I figure this one out ;-) -Mark ------------------------------------------- | Mark Mayo mark@quickweb.com | | C-Soft www.quickweb.com | ------------------------------------------- "To iterate is human, to recurse divine." - L. Peter Deutsch