Subject: Re: [vserver] DHCP
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Fri, 25 Jun 2010 21:06:46 +0200

On Fri, Jun 25, 2010 at 09:42:31AM -0700, Nirmal Guhan wrote:
> On Wed, Jun 23, 2010 at 8:28 PM, Herbert Poetzl <herbert@13thfloor.at> wrote:
> > On Wed, Jun 23, 2010 at 07:19:05PM -0700, Nirmal Guhan wrote:
> >> Trying to configure eth0 for dhco.

> >> I added NET_ADMIN to bcapabilities
> >> (Not secure but NET_RAW and NET_BROADCAST didn't help).

> > the guest can now mess with arbitrary host interfaces

> >> Doing dhclient eth0 on the guest,

> >> #dhclient eth0
> >> Cannot find device "etho"

> > your dhclient is broken, otherwise it would say eth0 :)

> That was a copy/paste error.

> >> eth0 is now lost.

> > removing the guest IP from eth0 makes it invisibe
> > for the guest ..

> >> From one of the earlier mails on the list, it appears that dhcp does
> >> not give real advantage. But in my case, I would have to automate
> >> stuff (for instance, host gets it address through dhcp and hence the
> >> address of guest is not fixed).

> > so the guest is supposed to share the host IP?
> > if so, I'd suggest to use a private IP and do S/DNAT

> You mean guest cannot get its address through DHCP ?

the guest _can_ get its address via DHCP when either
the host requests an IP via DHCP _for_ the guest, or
when you use network namespaces

> >> Also I have to avoid address conflicts

> > what should conflict and where?

> >> - can two VPS on the same subnet have a common IP

> > what is a VPS here, what is the subnet?
> > in general, normal Linux network rules apply

> I should have clarified this. 

> Does the guest have its own IP stack?

by default no (i.e. IP isolation is used), but when
you use network namespaces, then yes

> How does with destination IP address that of the guest 
> routed to the guest? 

I do not understand this question ...

> Does it happen within kernel (that kernel identifies it is
> some sort of virtual interface and sends to it) ?

I assume we are talking ip isolation mode, and if
yes, then the answer is: not at all ...

i.e. it is not necessary to 'identify' anything as
all networking happens on the host, the guest just
'uses' certain IPs to bind to ...

> >> - in other words is the guest IP visible outside the host ?

> > if you make it visible then yes ...
> > (usually this is a good idea :)

> Sorry not clear. How do I make it "invisible"?

by changing the scope so that it isn't visible on
the lan (if that is really what you want :)

best,
Herbert

> > best,
> > Herbert
> >
> >> --Nirmal
> >