From owner-freebsd-isp Mon Jan 27 17:25:42 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA03736 for isp-outgoing; Mon, 27 Jan 1997 17:25:42 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA03714 for ; Mon, 27 Jan 1997 17:25:38 -0800 (PST) Received: from panda.hilink.com.au (panda.hilink.com.au [203.2.144.5]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id OAA27268 for ; Mon, 27 Jan 1997 14:14:49 -0800 (PST) Received: (from danny@localhost) by panda.hilink.com.au (8.7.6/8.7.3) id JAA05144; Tue, 28 Jan 1997 09:18:25 +1100 (EST) Date: Tue, 28 Jan 1997 09:18:24 +1100 (EST) From: "Daniel O'Callaghan" To: david cc: sysops Subject: Re: Multiple IP addresse, hostnames on one machine In-Reply-To: <19970127201615.1b59db1b.in@alania.ssc.ac.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This is really a candidate for the upcoming HowTo section of the Handbook. On Mon, 27 Jan 1997, david wrote: > Is it possible to have multiple IP addresses on one machine without having > multiple ethernet cards.. > > We want to have one computer (for now) that runs DNS, WWW, FTP, TELNET, > POP, PPP and anything else. > We want to have > > www.rno.ssc.ac.ru > mail.rno.ssc.ac.ru > ftp.rno.ssc.ac.ru > telnet.rno.ssc.ac.ru > dialup.rno.ssc.ac.ru > admin.rno.ssc.ac.ru > > All running on one machine, whith the ability to expand and move each > service to it's own machine without having to have all the user change > thier configurations. You don't need multiple IP addresses for this. You want to use the DNS to manage this. Simply list each service separately in the DNS and make sure that users use the correct name for the service. When you want to split to multiple machines, simply reconfigure the DNS. Easy. Start: (zone file for rno.ssc.ac.ru) admin IN A 1.2.3.4 ftp IN CNAME admin www IN CNAME admin telnet IN CNAME admin mail IN CNAME admin Note that a CNAME record *must* point to an A record, not to another CNAME. After split: admin IN A 221.2.3.4 mail IN CNAME admin telnet IN CNAME admin www IN A 221.2.3.5 ftp IN CNAME www > I would assume it would just be a matter of putting multiple names in the > /etc/hosts file and using the same IP address Yes, but don't use the hosts file, use DNS. There are some DNS primers out there on the 'net. (Can anyone recommend URLs, please - I'd like to digest them into a FreeBSD HowTo) > But moving the service from this machine would have to change the ip, is > there anyway to aliase IP addresses and > have that address move with the aliased hostname? You can put multiple IP addresses onto a single machine. There are two basic cases: 1. The aliased address is part of the same subnet/network as the primary address. In this case, you need to specify a netmask of 0xffffffff (8 f's) and put the alias onto the primary ethernet interface, e.g. ed0. # ifconfig ed0 221.2.3.4 netmask 0xffffff00 # ifconfig ed0 221.2.3.5 netmask 0xffffffff alias When this happens, the machine will respond to arp requests for both addresses. 2. The aliased address is part of a different subnet/network from the primary IP address. I find that the best place to put these aliases is onto the lo0 interface. # ifconfig lo0 219.5.6.7 netmask 0xfffffff0 alias # ifconfig lo0 219.5.6.8 netmask 0xffffffff alias # ifconfig lo0 219.5.6.9 netmask 0xffffffff alias Note that the first alias in a given net/subnet must have the correct netmask for that net/subnet, while additional aliases use the netmask of all 1's (0xffffffff, 255.255.255.255). Since these aliases are part of a different subnet/net from the local ethernet, other machines on the local ethernet must be given routes to the network using the aliased machine's primary ethernet IP address as a gateway. regards, Danny