[Users] The routing function of OpenVZ node

Nick nick at somerandomnick.ano.mailgate.vanet.org
Sat Jan 29 22:01:43 EST 2011


Xinli,

On Fri, Jan 21, 2011 at 08:17:38PM +0800, niu xinli wrote:
>  Hi,
>    I am a newer to OpenVZ. We plan to use OpenVZ to build a virtual network
> to test our program. Since the vitual machines share a common kernel,I am
> wondering how is the routing function implemented?

OpenVZ doesn't implement its own routing.  If you think of each container
as a real machine, everything will make perfect sense.

>     For example,I create three nodes A,B and C. Config B as a route on the
> path from A to C.

A# route add C gw B
C# route add A gw B

> Then when A sends a packet to C,it will go through B.

yes

> But does B know that there is a packet passing through it?

The kernel knows about it, and tcpdump on B will show it.

> If B does,how can he know that?
> Because the packet is forworded in the kernel space.

You can ask the same question for a real machine, and you will get the
same answer: libpcap allows you to ask the (virtual) kernel for network
packets that it sees.

>    Thanks very much if anyone can give me some tips.

If my explanation is lacking, please ask more questions.

-- 
Wanna turn ICANN into ICANN't?  Join a darknet today:
http://www.anonet2.org/darknet_comparison


More information about the Users mailing list