Network Alias

Discussions related to using VirtualBox on Linux hosts.
Post Reply
alexis101
Posts: 4
Joined: 9. Dec 2008, 08:20

Network Alias

Post by alexis101 »

Hello,
My VirtualBox server is now in a data center. And I have a little problem. One of my guest need to have an 2 externals IP addresses so the network configuration for this one is bridged Network to eth0. The Data center gave me 1 primary IP address and 6 secondary ip addresses. So the only way to use the "Secondary addresses" is to use them as Aliases to eth0. But I need to gave 2 of them to my virtual guest... So far no luck. I have no idea how to do this or if it's even possible.

Any help would be great.

My Host os is Fedora core 10
HolgerB
Posts: 58
Joined: 28. Jul 2008, 23:36

Re: Network Alias

Post by HolgerB »

Hey alexis,

I´m no network expert by any means. So I might be wrong.

Wild speculation follows...:D
I never assigned more than one IP-adress to a Linux machine
but I did so for a Win2k3 host. I do not see a big difference
to a Linux host here. By "attaching" multiple IP-adresses to
one network adapter at a time two things change:
1st: The network adapter will react to more than one IP-address :)
2nd: You can bind separate servers / services to each IP-address

In your case your ISP hase blocked / reserved those 7 IP-adresses
for you. They are somewhat bound to your domain. May be they are
all 7 routed through to you when someone calls your domain.

So it´s not really neccessary to use the secondary adresses by
"attaching" them to eth0. See below...

Ok, that´s my theory on multiple IP-adresses...

By using a bridge / bridged mode for your VM network adapters this
simply equals to a "virtual switch" for me where both the network
cables of your VMs as well as the cable of your host and the incoming
network connections are plugged in.

This means that every VM should see the same packages as your host.

By assigning one ore two of the secondary IP addresses to one of the VMs
you should be perfectly be able to access the guest from outside.
Assigning two IPs to your guest OS is no VM-topic. This is the same as
when you do it with a physical machine.

You can easily experiment if assigning a secondary IP to a guest has
worked by "pinging" it from your host. This way you can ensure that
at least internal network communication works fine before looking
for problems outside your host.
alexis101
Posts: 4
Joined: 9. Dec 2008, 08:20

Re: Network Alias

Post by alexis101 »

Hello,
First of all thanks for your answer HolgerB. Most of what you said I already knew. And I already tried to give one of the "secondary IP" to my Virtual Machine. The result is:
- I can ping the IP of the Host from the VM.
- I can't ping any external IP from the VM.
- I can ping the VM ip from the host.
- When I tried to ping the VM ip form an external network I got from a windows machine :
Destination host unreachable from XXX.XXX.XXX.XXX
Where XXX.XXX.XXX.XXX is the ip of my host.
But from a linux workstation i got:
From XXX.XXX.XXX.XXX icmp_seq=1 Destination Host Prohibited
Haha!
Just added a foward rule to my firewall and voila! Everything work's fine now.
BTW I just solve the mystery while writhing this post!
So if anyone have the same problem the solution is here
Post Reply