From owner-freebsd-hackers Sat May 20 09:44:25 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA02634 for hackers-outgoing; Sat, 20 May 1995 09:44:25 -0700 Received: from leo.ibms.sinica.edu.tw ([140.109.40.249]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id JAA02624 for ; Sat, 20 May 1995 09:44:20 -0700 Received: (from taob@localhost) by leo.ibms.sinica.edu.tw (8.6.11/8.6.9) id AAA16222; Sun, 21 May 1995 00:41:35 +0800 Date: Sun, 21 May 1995 00:41:34 +0800 (CST) From: Brian Tao To: Paul Richards cc: freebsd-hackers@FreeBSD.org Subject: Re: alias ( secondary IP ) for Ethernet Ifaces in FreeBSD In-Reply-To: <199505201627.RAA29572@isl.cf.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: hackers-owner@FreeBSD.org Precedence: bulk On Sat, 20 May 1995, Paul Richards wrote: > > which will set your broadcast address to 131.251.122.1 which is wrong. I'd > also like to be able to treat an alias as a separate interface and do > things like > > ifconfig lnc0:1 I like this format too. Makes getting at each numbered interface much easier than remembering IP addresses and looking through netstat. > You need to specify a netmask for the aliases so that the routing code can > distinguish between them, you can access the aliases from the host then. I've been using the usual 0xffffff00 netmask for all my local machines on the same C-class subnet. Do I need to specify something different for the aliases? This is what I get on host leo, initially with one IP address assigned to it (140.109.40.249). I want to add 140.109.40.238 to it: # netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll ed1 1500 00.00.e8.cb.cd.58 3916567 1 2536025 11 584527 ed1 1500 140.109.40 leo 3916567 1 2536025 11 584527 lp0* 1500 0 0 0 0 0 lo0 16384 67 0 67 0 0 lo0 16384 your-net localhost 67 0 67 0 0 # ping 140.109.40.238 PING 140.109.40.238 (140.109.40.238): 56 data bytes ^C --- 140.109.40.238 ping statistics --- 6 packets transmitted, 0 packets received, 100% packet loss # ifconfig ed1 inet 140.109.40.238 netmask 0xffffff00 alias ifconfig: ioctl (SIOCAIFADDR): File exists # netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll ed1 1500 00.00.e8.cb.cd.58 3916601 1 2536043 11 584527 ed1 1500 140.109.40 leo 3916601 1 2536043 11 584527 ed1 1500 140.109.40 140.109.40.238 3916601 1 2536043 11 584527 lp0* 1500 0 0 0 0 0 lo0 16384 67 0 67 0 0 lo0 16384 your-net localhost 67 0 67 0 0 # ping 140.109.40.238 PING 140.109.40.238 (140.109.40.238): 56 data bytes ping: sendto: Host is down ping: wrote 140.109.40.238 64 chars, ret=-1 ping: sendto: Host is down ping: wrote 140.109.40.238 64 chars, ret=-1 ping: sendto: Host is down ping: wrote 140.109.40.238 64 chars, ret=-1 ^C --- 140.109.40.238 ping statistics --- 6 packets transmitted, 0 packets received, 100% packet loss # rsh aries ping 140.109.40.238 PING 140.109.40.238 (140.109.40.238): 56 data bytes 64 bytes from 140.109.40.238: icmp_seq=0 ttl=255 time=2.967 ms 64 bytes from 140.109.40.238: icmp_seq=1 ttl=255 time=1.633 ms 64 bytes from 140.109.40.238: icmp_seq=2 ttl=255 time=1.440 ms 64 bytes from 140.109.40.238: icmp_seq=3 ttl=255 time=1.373 ms ^C --- 140.109.40.238 ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 1.373/1.853/2.967 ms Do I need to restrict my netmask more? -- Brian ("Though this be madness, yet there is method in't") Tao taob@gate.sinica.edu.tw <-- work ........ play --> taob@io.org