[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vbox-users
Subject:    Re: [vbox-users] Howto setup network for access complete from Host
From:       Javier Enrique =?iso-8859-1?q?Ti=E1_Mar=EDn?= <javier () eftssc ! co ! cu>
Date:       2007-03-31 22:10:05
Message-ID: 200703311810.06421.javier () eftssc ! co ! cu
[Download RAW message or body]

El Miércoles, 28 de Marzo de 2007 17:37, Luis Gallardo escribió:
> Javier, you haven't told us what your host system is...but if you're
> using Linux here you are:
>
> I set my networking with bridging. My script in the Linux host is:
>
> Host:
>
> tunctl -t tap0 -u lgallard
> chmod 666 /dev/net/tun
> /sbin/ip link set tap0 up
> /sbin/ip addr add 172.16.16.16/32 dev tap0
> echo "1" > /proc/sys/net/ipv4/conf/tap0/proxy_arp
> echo "1" > /proc/sys/net/ipv4/ip_forward
> parprouted eth0 tap0
> echo "tap0 is set"
>
> In this example lgallard is the user who launches the virtual
> machines. Then, I set a static ip in the guest OS (no matter if it's
> Linux or Windows)
>
> Guest (Linux):
>
> Add to the /etc/network/interfaces this lines:
>
>
> # The primary network interface
> auto eth0
> iface eth0 inet static
> address 192.168.2.113
> netmask 255.255.255.0
> gateway 192.168.2.1
>
> Set your ip, netmask and gateway according to the network where the
> VM's will be connected. If you want DNS resolution, add your dns
> servers in the /etc/resolv.conf
>
> Guest (Windows)
>
> Go to the  TCP/IP interface properties a set the values for a static
> IP connection and DNS resolution.
>
> On 3/28/07, Javier Enrique Tiá Marín <javier@eftssc.co.cu> wrote:
> > Hi:
> >
> > I'm new user in the use of the Virtual Machine. A like very much the
> > VirtualBox.
> > Congratulations to the all people behind this great job.
> >
> > From Guest I can access to Outside (Real) Network using NAT in Settings
> > -> Network -> Adapter0 -> Attached to
> >
> > But,
> >
> > From Host I can't access Inside (Virtual) Network
> >
> > I readed of the Manual, Help -> Contents -> Networking in Virtual
> > Machines. I use Host Interface but don't work.
> >
> > The way port-forwading I don't like, I will get access complete from Host
> > to Guest
> >
> > Somebody, can help me with this situation?
> >
> > TIA,
> > JETM
> >
> > p.d: Apologize, the english isn't my navite idiom.
> >
> > _______________________________________________
> > vbox-users mailing list
> > vbox-users@virtualbox.org
> > http://vbox.innotek.de/mailman/listinfo/vbox-users

Thanks you, it's working very well.

My contribution is this script, named vboxnet.sh. You can use with vboxnet.sh 
start|stop

# cat ~bin/vboxnet.sh
#!/bin/sh

USER_NAME="javier"
HOST_IP="172.16.16.15/32"
IFACE_BRIDGE="tap0"
IFACE_LOCAL="eth0"

case "$1" in
  start)
        echo "Setting $IFACE_BRIDGE bridge networking..."
        tunctl -t $IFACE_BRIDGE -u $USER_NAME
        chown root.vboxusers /dev/net/tun
        chmod g+rw /dev/net/tun
        ip link set $IFACE_BRIDGE up
        ip addr add $HOST_IP dev $IFACE_BRIDGE
        echo "1" > /proc/sys/net/ipv4/conf/$IFACE_BRIDGE/proxy_arp
        echo "1" > /proc/sys/net/ipv4/ip_forward
        parprouted $IFACE_LOCAL $IFACE_BRIDGE
        echo "DONE"
        ;;
  stop)
        echo "Stopping $IFACE_BRIDGE..."
        tunctl -d $IFACE_BRIDGE
        echo "DONE"
        ;;
esac

exit 0

#

And little changes for automation the ejecution VirtualBox:

~/.bashrc
alias VirtualBox='sudo ~/bin/vboxnet.sh start; VirtualBox; sudo 
~/bin/vboxnet.sh stop'

/etc/sudoers
javier localhost = NOPASSWD: /home/javier/vbox_net.sh

Greetings,
JETM

_______________________________________________
vbox-users mailing list
vbox-users@virtualbox.org
http://vbox.innotek.de/mailman/listinfo/vbox-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic