Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

2 public ip's on 2 nics (problem)

已查看 31 次
跳至第一个未读帖子

Daryl Chance

未读,
2002年9月14日 22:44:512002/9/14
收件人
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

未读,
2002年9月15日 05:25:352002/9/15
收件人
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

0 个新帖子