<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Dear Silvio,<br>
<br>
</tt>
<blockquote
 cite="mid:d2fe10570903160928u18650e4dv672e5e7e2db66d4f@mail.gmail.com"
 type="cite">
  <pre wrap=""><tt>
I need to connect the guest machine to internet for some DNSSEC tests
and add some packages. This guest machine must be physically connected
to my house&acute;s subnet (ethernet). I didn&acute;t want change my home network
only for this test. Here is a little schema of my home network:

INTERNET ----- DLINK ROUTER (ADSL Router) ----- OPENSUSE (primary O.S)
OpenSuse address: 172.16.149.7

The Netkit is installed in opensuse. The home subnet is
172.16.149.0/255.255.255.240

You told that need to do some manual setup to configure bridging instead.
</tt></pre>
</blockquote>
<tt><br>
Ok, so down with some instructions. There are two possibilities to
achieve what you need. One is to configure static routing and the
other, that I have been hinting at, is to use bridging.<br>
<br>
In the static routing solution your virtual machine will lay in your
house's subnet, but still be reachable via an intermediate router (your
host). Instructions to implement this solution follow. All the commands
must be executed on the host as root.<br>
</tt>
<ol>
  <li><tt>Start the Internet connected virtual machine as usual:<br>
vstart recursive --eth0=tap,172.16.149.7,172.16.149.10 -M 128<br>
(observe that this will make duplicate addresses exist on the network
for a while)<br>
    </tt></li>
  <li><tt>Delete the IP address of the tap interface on the host:<br>
ifconfig nk_tap_${USER} 0.0.0.0</tt></li>
  <li><tt>Add a static route on your host, pointing to the virtual
machine:<br>
route add 172.16.149.10 dev nk_tap_${USER}</tt></li>
  <li><tt>Enable proxy ARP:<br>
echo 1 &gt; /proc/sys/net/ipv4/conf/nk_tap_${USER}/proxy_arp<br>
echo 1 &gt; /proc/sys/net/ipv4/conf/eth0/proxy_arp (where eth0 is the
name of the Ethernet interface on your host)<br>
    </tt></li>
  <li><tt>Disable NAT:<br>
iptables -t nat -D POSTROUTING -j MASQUERADE</tt></li>
</ol>
<tt>Well done. Now you should be able to reach your home network from
the virtual machine and vice versa.<br>
<br>
In the bridging solution the virtual machine will appear as if it were
physically connected to your house's subnet (i.e., no routers in the
middle). Be aware that this solution establishes a bridge between the
virtual machine and your home network, thus&nbsp; compromising Internet
connectivity on your host! You have been warned!<br>
Instructions follow.<br>
</tt>
<ol>
  <li><tt>Start the Internet connected virtual machine as usual:<br>
vstart recursive --eth0=tap,172.16.149.7,172.16.149.10 -M 128</tt></li>
  <li><tt>Reconfigure the default gateway inside the virtual machine:<br>
route del default gw </tt><tt>172.16.149.7<br>
route add default gw &lt;ip_address_of_your_host's_default_gateway&gt;<br>
    </tt></li>
  <li><tt>Disable NAT:<br>
iptables -t nat -D POSTROUTING -j MASQUERADE<br>
    </tt></li>
  <li><tt>Create a new bridge on the host:<br>
brctl addbr br0</tt></li>
  <li><tt>Bridge the tap interface and the Ethernet interface together:<br>
brctl addif br0 nk_tap_${USER}<br>
brctl addif br0 eth0</tt></li>
  <li><tt>Enable the bridge:<br>
ifconfig br0 up<br>
    </tt></li>
</ol>
<tt>
<blockquote type="cite">
  <pre wrap=""><tt>
Can you help me? Your name will be in my work :)

Thank you soo much,

</tt></pre>
</blockquote>
<br>
<br>
That's it. Hope this helps.<br>
<br>
P.S. Thanks for the citation! :-)<br>
<br>
Regards,<br>
Massimo.<br>
<br>
</tt><br>
</body>
</html>