ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Alexey Sidorov <alex@reutman.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] virtualbox & network
Date: Fri, 20 Jul 2007 09:15:25 +0400
Message-ID: <46A044ED.4050401@reutman.ru> (raw)
In-Reply-To: <200707191632.04098.trash4@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 3051 bytes --]

Guest007 пишет:
> В сообщении от Четверг 19 июля 2007 Alexey Sidorov написал(a):
> 
>> Про сеть продолжать? :)
> 
> Да, конечно!!
> Очень надо хотя бы так вот кратко, но применительно именно к Альту и 
> по-русски :-)
Ну про тип сети "NAT" говорить нечего. галочку поставил - сеть есть
в гостевой ставим автоматическое определение ip (то бишь dhcp)
в этом раскладе доступа извне нет. Вернее можно сказать что между гостем и хостом стоит NAT, который
можно настроить для проброса отдельных портов в гостевую. Как это сделать - читайте мануал, я понял,
но заморачиваться не стал, мне это не подходило

Дальше - тип "хост-интерфейс"
С этим подключением гостевой системе можно определить собственный IP, со всеми вытекающими.
Т.е. ваша гостевая будет функционировать как отдельная машина со своим IP.
В моём случае изначально хост-система имела след. параметры:
eth0, 192.168.0.3/24, default via 192.168.0.254
Нужно, что-бы гостевая система имела адрес в диапазоне 192.168.0.0/24, т.е. принадлежала той-же LAN

Что делаем:

1. в /etc/modules вписать tun. После этого сделать modprobe tun
2. создать бридж в etcnet :
	а. создать каталог /etc/net/ifaces/br0, и в него положить след. файлы:
		brctl:
			stp AUTO on
		ipv4address:
			192.168.0.3/24
		ipv4route:
			default via 192.168.0.254
		options:
			TYPE=bri
			HOST='eth0'
3. Из /etc/net/ifaces/eth0 убираем ipv4address и ipv4route

   Обращаю внимание, что настройки интерфейса хост машины перекочевали из eth0 в br0

4. рестартим сеть, проверяем что у хост-машины она работает, и интерфейс имеет адрес 192.168.0.3
5. В свойствах сети гостевой системы ставим:
	Присоединён к: хост-интерфейс
	Имя интерфейса: <пусто>
	Программа настройки: /home/alex/.VirtualBox/create.sh
	Программа удаления: /home/alex/.VirtualBox/remove.sh
   /home/alex/.VirtualBox/ - естественно можете заменить на свой путь, который вам удобен
   Создаем эти два файла, делаем их запускаемыми.
   Их содержимое (в create.sh не забудьте заменить alex на свой логин :):
	/home/alex/.VirtualBox/create.sh :
#!/bin/bash
# Create an new TAP interface for the user 'alex' and remember its name.
interface=`sudo /usr/bin/VBoxTunctl -b -u alex`
# If for some reason the interface could not be created, return 1 to tell this to VirtualBox.
if [ -z "$interface" ]; then
exit 1
fi
# Write the name of the interface to the standard output.
echo $interface
# Bring up the interface.
sudo /sbin/ifconfig $interface up
# And add it to the bridge.
sudo /sbin/brctl addif br0 $interface

	/home/alex/.VirtualBox/remove.sh :
#!/bin/bash
# Remove the interface from the bridge.  The second script parameter is the interface name.
sudo /sbin/brctl delif br0 $2
# And use VBoxTunctl to remove the interface.
sudo VBoxTunctl -d $2

6. Запускаем гостевую систему, прописываем там в настройках сети адрес который нужен из диапазона (в
моём случае - 192.168.0.5)

Всё. вроде ничего не забыл.

-- 
Alexey Sidorov
	mailto:alex@reutman.ru
	JID: alex@reutman.ru
	ICQ: 5052225



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2007-07-20  5:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 10:20 [sisyphus] vmware-player Guest007
2007-07-17 10:31 ` Алексей Шенцев
2007-07-17 10:51   ` Guest007
2007-07-17 11:12     ` Алексей Шенцев
2007-07-17 12:13   ` Guest007
2007-07-17 12:19     ` Алексей Шенцев
2007-07-17 12:35       ` Guest007
2007-07-17 14:15         ` Алексей Шенцев
2007-07-17 12:24     ` Guest007
2007-07-20  9:24   ` Guest007
2007-07-20  9:52     ` Алексей Шенцев
2007-07-20 10:12       ` Guest007
2007-07-20 11:52       ` Guest007
2007-07-21  5:42         ` Vitaly Lipatov
2007-07-25 10:57         ` Guest007
2007-07-25 11:55           ` Alexey Novikov
2007-07-21  5:40     ` Vitaly Lipatov
2007-07-17 10:51 ` Alexey Sidorov
2007-07-17 12:02   ` Andrii Dobrovol`s`kii
2007-07-17 12:29     ` Guest007
2007-07-18 18:05   ` Sergey Kuznetsov
2007-07-18 18:29     ` Alexey Sidorov
2007-07-19  7:04       ` Guest007
2007-07-19  7:17         ` Alexey Sidorov
2007-07-19  9:58           ` Alexey Sidorov
2007-07-19 12:32             ` Guest007
2007-07-20  5:15               ` Alexey Sidorov [this message]
2007-07-24  9:34                 ` [sisyphus] virtualbox & network Guest007
2007-07-24 10:00                   ` Alexey Sidorov
2007-07-24 10:17                     ` Guest007
2007-07-24 10:27                       ` Alexey Sidorov
2007-11-12 12:21   ` [sisyphus] vmware-player Sergey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46A044ED.4050401@reutman.ru \
    --to=alex@reutman.ru \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git