From owner-freebsd-questions Mon Jan 13 5:44: 9 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A927037B401 for ; Mon, 13 Jan 2003 05:44:07 -0800 (PST) Received: from mail.adelphia.net (pa-plum1b-166.pit.adelphia.net [24.53.161.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id D45C243EB2 for ; Mon, 13 Jan 2003 05:44:01 -0800 (PST) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com ([172.16.0.95]) by mail.adelphia.net (8.12.3/8.12.3) with ESMTP id h0DDixAg004752; Mon, 13 Jan 2003 08:45:07 -0500 (EST) (envelope-from wmoran@potentialtech.com) Message-ID: <3E22B6B4.70401@potentialtech.com> Date: Mon, 13 Jan 2003 07:53:08 -0500 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021127 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anand Buddhdev Cc: questions@freebsd.org Subject: Re: Multiple network cards with IP addresses in the same network References: <20030113114954.GQ1330@anand.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Anand Buddhdev wrote: > I have a FreeBSD 4.7 system, with 3 ethernet cards. The first two > are recognised as fxp0 and fxp1 and the second as em0 (intel gigabit > card). I configured the em0 with address 192.168.0.1/24. I then wanted > to configure fxp0 with the address 192.168.0.2/24, and also connect it > to the switch so that I can connect to the server via both addresses. > However, FreeBSD's ifconfig command fails, and won't let me add the second > address to the fxp0 interface. I read the manual page about ifconfig, > and read about aliases, where it said that for aliases, I must use the > netmask /32. When I do try to add the second address with a netmask of > /32, it works, but it doesn't make sense to me. How is that interface > going to to know that it is part of a /24 network if I use a /32 netmask? > > Would anyone be kind enough to explain why: > > 1. For aliases, I need the /32 mask I didn't know that you did. I've certainly had aliases that weren't /32 > 2. Adding a second IP to a *different* network card in the same server > does not work if the second IP is within the network of the first one. Because it breaks routing and the basic concept of IP addys and netmasks. If you have two NICs on the same network, how is the kernel supposed to route packets? If you want this setup as a failover solution, there are other ways. There's a program in the ports (I can't remember the name, you'll have to do some research) that will monitor an interface, and if it becomes non- responsive, run a script of your choosing. Thus, you can have it start up the other network card if the first fails. If failover isn't what you're looking for, then I'd reconsider your network topology. It doesn't really make sense to have 2 NICs with the same network number in one machine. -- Bill Moran Potential Technologies http://www.potentialtech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message