Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup two ip aliases on a FreeBSD server's NIC that I intend to use to test a Virtual Host configuration in Apache. My box is running XP natively and FreeBSD virtually using VirtualBox. The XP box connects to a router which is also connected to the server. The problem is that I can't ping the aliased ips unless I'm running a session (through ssh) on the server. Otherwise, everything can ping everything else, including the server's 'regular' ip.

Is this a router issue? A hosts file configuration problem? Something else?

EDIT

For more clarity, the relevant entries in the server's rc.conf file:

ifconfig_rl0="inet 192.168.2.2 netmask 255.255.255.0"
ifconfig_rl0_alias0="inet 192.168.80.1 netmask 255.255.255.255"
ifconfig_rl0_alias1="inet 192.168.80.2 netmask 255.255.255.255"
share|improve this question
    
Please clarify what you mean by "aliased ips". –  John Gardeniers Oct 8 '09 at 1:45
    
I've added aliases to the server's NIC. –  gvkv Oct 8 '09 at 1:54
add comment

3 Answers 3

up vote 1 down vote accepted

Are the secondary IPs in the same subnet as the primary IP? Perhaps that's too obvious but that would be the first thing to check since you didn't specify...

Ah...

I'm not quite sure what you're trying to accomplish. By using /32s it almost looks like you're trying to apply the concept of loopback IPs to a server, but since the server's not a router, and not participating in a dynamic routing protocol, it won't work.

It is valid to have multiple subnets on the same ethernet, but you still need a gateway. Typically when I do something like this I would define my two networks (192.168.2.0/24 and 192.168.80.0/24). Then, on the router interface for that LAN segment you would bring up gateway IPs for both networks. An example of this from a cisco router:

interface GigabitEthernet1/6
 ip address 172.16.45.1 255.255.255.224
 ip address 172.16.45.65 255.255.255.248 secondary

Then on any server on that LAN I can use IPs from either the 172.16.45.0/27 or 172.16.45.64/29 networks, but if they want to talk between subnets they will still need to use the router.

Hope that helps some.

share|improve this answer
    
No and I've edited my post with some configuration details. –  gvkv Oct 8 '09 at 1:54
1  
Looks like you hit it bang-on, jj33. 192.168.80.1/32 isn't in the same subnet as 192.168.2.2/24. –  MikeyB Oct 8 '09 at 2:26
    
Thanks. This helps a lot. –  gvkv Oct 8 '09 at 3:16
add comment

Why can't you use addresses in the same subnet as the primary interface? This would make things a lot easier. And I am not really sure if your FreeBSD Server is a physical machine or running on your XP workstation in VirtualBox.

Regardless of that, in your configuration it would be necessary to tell your router to use 192.168.2.2 as the gateway for the 192.168.80 network as neither the router nor XP are aware that the .80 network even exists (that is even true when your FreeBSD server is only virtual on XP).

share|improve this answer
    
Thanks. I get it now. –  gvkv Oct 8 '09 at 3:15
add comment

MikeyB's right. You need to route the requests for 192.168.80 to 192.168.2.2 I assume that 192.168.2.2 is on the same network as the xp box?

from xp :

route add 192.168.80.0 mask 255.255.255.0 192.168.2.2
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.