2 public ip's on 2 nics (problem)

31 views
Skip to first unread message

Daryl Chance

unread,
Sep 14, 2002, 10:44:51 PM9/14/02
to
Hi,

I've got a server I'm trying to bring up that has 2
nics in it. I have 2 valid public ip's, so thats not
the issue. the 2 nics are 2 seperate things. one is
for dns and one is for mail (I know, I could just go
with 1, but I'm trying to get this working anyhow).

I'm using FreeBSD 4.6.2 pl2. The nic's are:
3Com 3c905C-TX Fast Etherlink XL (xl0 - has current
ip)
Intel Pro 10/100B/100+ Ethernet (fxp0 - one i'm trying
to add ip to)

rc.conf looks like:
defaultrouter="65.221.xxx.xw"
hostname="mail.xxx.com"
#only working for xl atm. working on it.
ifconfig_xl0="inet 65.221.xxx.xx netmask
255.255.255.192"
ifconfig_fxp0="inet 65.221.xxx.xy netmask
255.255.255.192"

I've tried switching the order, letting one boot then
adding the ip to the other nic....nothing. same
error.

If I do an ifconfig fxp0 add 65.221.xxx.xy netmask
255.255.255.0, it adds it, but i can't ping it (more
then likely because of the netmask AND because it's an
alias?

adding it with 255.255.255.192 gives me:
ifconfig: ioctl (SIOCAIFADDR): File exists

Can anyone tell me what I'm doing wrong, or what I'm
assuming wrong?

I'd really like to get both of these nics up with a
public ip.

Thanks,
Daryl

=====
&lt;---------------------------------------------------------------&gt;<BR>&lt;- Daryl Chance&nbsp; - A programmer is someone who solves a &nbsp;&nbsp; -&gt;<BR>&lt;- Programmer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - problem you didn't know you had in a -&gt;<BR>&lt;- ----------------- - way you don't understand. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt;<BR>&lt;- Belial of -E- &nbsp;&nbsp;&nbsp; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - ????? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt;<BR>&lt;---------------------------------------------------------------&gt;

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message

Matthew Seaman

unread,
Sep 15, 2002, 5:25:35 AM9/15/02
to
On Sat, Sep 14, 2002 at 07:44:36PM -0700, Daryl Chance wrote:

> I've got a server I'm trying to bring up that has 2 nics in it. I
> have 2 valid public ip's, so thats not the issue. the 2 nics are 2
> seperate things. one is for dns and one is for mail (I know, I
> could just go with 1, but I'm trying to get this working anyhow).

> rc.conf looks like:
> defaultrouter="65.221.xxx.xw"
> hostname="mail.xxx.com"
> #only working for xl atm. working on it.
> ifconfig_xl0="inet 65.221.xxx.xx netmask
> 255.255.255.192"
> ifconfig_fxp0="inet 65.221.xxx.xy netmask
> 255.255.255.192"

> If I do an ifconfig fxp0 add 65.221.xxx.xy netmask 255.255.255.0, it


> adds it, but i can't ping it (more then likely because of the
> netmask AND because it's an alias?

> adding it with 255.255.255.192 gives me:
> ifconfig: ioctl (SIOCAIFADDR): File exists

Yes --- adding two IP numbers on the same network, even if they are on
separate NICs is always going to be tricky. The problem is
essentially to do with routing --- which NIC does the OS use to send
packets out of? Which IP number does it put into the packets as the
return address?

Assuming you aren't interested in the ng_one2many(4) approach, which
effectively gloms together several separate NICs and makes them behave
collectively like one interface, then you've got to make it clear
somehow that one of the addresses is the default for outgoing packets,
and that the other should be used only when specifically requested.

About the only possible answer I can think of is that this is
essentially the same problem as having multiple alias addresses on the
same NIC, so the same rules should apply: the first IP number per
network gets configured with the appropriate netmask for the subnet,
second and subsequent addresses use the all ones netmask, even if
they're configured on different physical interfaces.

ifconfig xl0 inet 65.221.xxx.xx netmask 255.255.255.192 up
ifconfig fxp0 inet 65.221.xxx.xy netmask 255.255.255.255 up

That should make xl0 the default interface for outgoing traffic from
the machine. Now this is all untested and may or may not work. Give
it a go and see what happens.

Cheers,

Matthew

--
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK

Reply all
Reply to author
Forward
0 new messages