<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/03/2012 10:08 PM, Gene Czarcinski
      wrote:<br>
    </div>
    <blockquote cite="mid:506C8D31.6080802@czarc.net" type="cite">OK,
      either I have taken a stupid pill and am missing something basic
      or routed network do not work.
      <br>
      <br>
      I assume that, if they did work, it would be in more or less that
      same manner as a nat network as far as ping'ing, ssh'ing, etc. to
      another real host on the same real LAN as the virtualization host.
      At least that is what I believe I should expect.
      <br>
    </blockquote>
    <br>
    I use routed networks, but they require some extra work. The docs
    [1] say that "This is a variant on the default network which routes
    traffic from the virtual network to the LAN <u>without applying any
      NAT</u>. It requires that the IP address range be <u>pre-configured
      in the routing tables of the router on the host network</u>."
    (emphasis mine) The way I read into this is that you are responsible
    for routing packets yourself. The docs say that you have to use IP
    addresses that are visible by the host and external machines and
    configure your routing table, so that it forwards packets to the
    VMs. I am not sure how to do that, but I have a different solution
    -- I use a pair of IP addresses for each VM: external (real and
    configured on the host) and internal. Then I have a SNAT + DNAT pair
    of iptables rules that expose the VM to the outside world in a
    manner similar to the one used in DMZ setups:<br>
    <br>
    ubuntu@thehost:~$ sudo iptables -t nat -L -n<br>
    Chain PREROUTING (policy ACCEPT)<br>
    target     prot opt source               destination         <br>
    DNAT       all  --  0.0.0.0/0            X.Y.Z.120          
    to:10.1.1.2<br>
    <br>
    ...<br>
    <br>
    Chain POSTROUTING (policy ACCEPT)<br>
    target     prot opt source               destination         <br>
    SNAT       all  --  10.1.1.2             0.0.0.0/0           
    to:X.Y.Z.120<br>
    <br>
    I am not sure if anyone else is doing the SNAT/DNAT thing to routed
    networks, but it's been working quite nicely for me so far.<br>
    <br>
    Best,<br>
    Hristo<br>
    <br>
    [1] <a class="moz-txt-link-freetext" href="http://libvirt.org/formatnetwork.html#examplesRoute">http://libvirt.org/formatnetwork.html#examplesRoute</a><br>
  </body>
</html>