# Opening ports on a virtual IP



## ll357524 (Jun 7, 2009)

Need some help here:

Version:
FreeBSD mail 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 01:43:02 UTC 2008     root@palmer.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  amd64

I have added an alias IP address to the primary em0 by modifying /etc/rc.conf but cannot hit the IP address from external internet.

Is there anything special I need to do?

inet 130.177.97.249 netmask 0xffffffe0 broadcast 210.177.97.255
inet 130.177.97.240 netmask 0xffffffe0 broadcast 210.177.97.255

Thanks in advance


----------



## SirDice (Jun 7, 2009)

An alias usually has a 255.255.255.255 netmask. Is that address also routed to you?


----------



## DutchDaemon (Jun 7, 2009)

Set the netmask of the alias to 255.255.255.255.


```
alias   Establish an additional network address for this interface.  This
             is sometimes useful when changing network numbers, and one wishes
             to accept packets addressed to the old interface.  If the address
             is on the same subnet as the first network address for this
             interface, a non-conflicting netmask must be given.  Usually
             0xffffffff is most appropriate.
```

This may not solve the problem, but it's the advised way to do it.


----------



## ll357524 (Jun 7, 2009)

Wow what a fast response!

Yes - I had initially tried 255.255.255.255, that didn't work thats why I changed it to /224.

Any other ideas?


----------



## SirDice (Jun 7, 2009)

Yes, is your ISP actually routing that address to you?


----------



## DutchDaemon (Jun 7, 2009)

From the Netherlands, the entire network is unreachable anyway ... (from 5 different AS's).


----------



## ll357524 (Jun 7, 2009)

Sorry --- the IP was changed, its not the actual IP (its a customers server)...


----------



## DutchDaemon (Jun 7, 2009)

Right 

Any chance there's a static or persisting ARP entry on a CPE router? Was the IP address bound to different hardware before?


----------



## vivek (Jun 7, 2009)

You need something as follows in rc.conf

```
defaultrouter="130.177.97.254"
ifcifconfig_em0="inet 130.177.97.249 netmask 255.255.255.192 media 10baseT/UTP mediaopt full-duplex"
onfig_IFACE_alias0="inet 130.177.97.240 netmask 255.255.255.0"
```
Once done restart both networking and routing service. Make sure 130.177.97.240 is routable to your VLAN or main server IP 130.177.97.249.


----------

