C? V?ng a ?crit :
> + create a bridge br0, add eth1 to it without any IP, assign the (should be) 
> eth1 IP to br0, set the route etc... -> the host can connect to the internet 
> normally (if not then I won't be able to write this, lol), then add tap0 (for 
> the VM) to it.
>   
Correct.

> + set forwarding, proxy_arp (is this really needed?) for the network 
> interfaces (all three: eth1, br0, tap0)
>   
Correct (proxy_arp not required when using a bridge).

> + start the VM with tap0. Then if I add the route "10.0.0.0 dev eth0" inside 
> the VM I can ping the host IP, but can't reach anything else, even the router 
> of my LAN.
>
> I think I have misconfigured the host somewhere but can't figured out where 
> is it yet :-/
>   
We lack some information here: what are your host and guest network
configuration exactly?

But even without knowing it I would guess this is a standard routing
problem.

You are probably using an internal network for your guest. You host
knows it so it knows where it should send replies to a ping request.

But when you ping outside this environment, eg your host's gateway, then
the ICMP packet comes to it through standard default routes, but the
gateway doesn't know the route to send the answer back (through your
host) to your guest.

So here are 3 classic solutions (exclusive: only one of them needed):
- use an IP address from already known network, eg same network as your
host ; you can do this because you are using a bridge (= virtual switch) ;
- masquerade the guest outgoing connections with the host's external IP
address (use iptables -j SNAT on the host) ;
- configure routing any place your need it.

-- 
Jean Christophe "????" ANDR?   ? ? ?   Responsable technique r?gional
Bureau Asie-Pacifique (BAP)    ? ? ?   http://www.asie-pacifique.auf.org/
Agence universitaire de la Francophonie (AuF)  ? ? ?  http://www.auf.org/
Adresse postale : AUF, 21 L? Th?nh T?ng, T.T. Ho?n Ki?m, H? N?i, Vi?t Nam
T?l. : +84 4 9331108  ?  Fax : +84 4 8247383  ?  Cellul. : +84 91 3248747
? Note personnelle: merci d'?viter de m'envoyer des fichiers PowerPoint ?
? ou Word, cf http://www.gnu.org/philosophy/no-word-attachments.fr.html ?

Trả lời cho