Tauno Voipio wrote:
>
> The SMB broadcasts are strictly the local subnet only. You
> cannot route (network level, IP, transfer) the LAN broadcasts.
>
> Are you using a tun (IP level) or a tap (Ethernet level) interface?
>
> As far as I see, you ought to bridge the local nets (192.168.0.x)
> together using the link level (tap) interfaces to pass the broadcasts.
Thanks for the hint. I got it working with a bridge. The new contents of the script when QEMU starts
is as follows:
================================================== =========
#!/bin/sh
#
# script to bring up the tun device in QEMU in bridged mode
#
# This script bridges eth0 and tap0. First take eth0 down, then bring it up with IP 0.0.0.0
#
sudo /sbin/ifdown eth0
sudo /sbin/ifconfig eth0 0.0.0.0 up
#
# Bring up tap0 with IP 0.0.0.0, create bridge br0 and add interfaces eth0 and tap0 to bridge
#
sudo /sbin/ifconfig tap0 0.0.0.0 promisc up
sudo /sbin/brctl addbr br0
sudo /sbin/brctl addif br0 eth0
sudo /sbin/brctl addif br0 tap0
#
# As we have only a single bridge and loops are not possible, turn spanning tree protocol off
#
sudo /sbin/brctl stp br0 off
#
# Bring up the bridge with IP 192.168.1.3 and add the default route
#
sudo /sbin/ifconfig br0 192.168.1.3 up
sudo /sbin/route add default gw 192.168.1.1
================================================== =
When QEMU exits, the following script restores the normal networking:
================================================== =
#!/bin/sh
#
# Script to bring down and delete bridge br0 when QEMU exits
#
# Bring down eth0 and br0
#
sudo /sbin/ifdown eth0
sudo /sbin/ifdown br0
#
# Delete the bridge
#
sudo /sbin/brctl delbr br0
#
# bring up eth0 in "normal" mode
#
sudo /sbin/ifup eth0
================================================== ======
The final piece is to configure the Windows virtual machine to have an unused address in the
192.168.1.0/24 network.
With this setup, all my SMB shares are available in the guest and host OS's, just the way I wanted.
Larry
|