LINUX.ORG.RU

Есть в мануале такая вот глава. Вроде понятно что в гостевой ОС писать. Тогда что и где писать в хостовой ОС?

3.7.3 Using the user mode network stack

By using the option `-net user' (default configuration if no `-net' option is specified), QEMU uses a completely user mode network stack (you don't need root priviledge to use the virtual network). The virtual network configuration is the following:

QEMU VLAN <------> Firewall/DHCP server <-----> Internet | (10.0.2.2) | ----> DNS server (10.0.2.3) | ----> SMB server (10.0.2.4)

The QEMU VM behaves as if it was behind a firewall which blocks all incoming connections. You can use a DHCP client to automatically configure the network in the QEMU VM. The DHCP server assign addresses to the hosts starting from 10.0.2.15.

In order to check that the user mode network is working, you can ping the address 10.0.2.2 and verify that you got an address in the range 10.0.2.x from the QEMU virtual DHCP server.

Note that ping is not supported reliably to the internet as it would require root priviledges. It means you can only ping the local router (10.0.2.2).

When using the built-in TFTP server, the router is also the TFTP server.

When using the `-redir' option, TCP or UDP connections can be redirected from the host to the guest. It allows for example to redirect X11, telnet or SSH connections.

SVH
() автор топика

Псевдографика отличается от оригинала. Кстати при всём этом в WinXP почему то невидно сетевой карты.

SVH
() автор топика

>Другие варианты -net не работают.

Всмысле, "не работают", не можешь настроить?

sdio ★★★★★
()
Ответ на: комментарий от sdio

Я настраивал -net tun но qemu ни в какую не может его сконфигурировать под себя. -net nic,vlan=0 -net user,vlan=0 вместе работают. Появляется сетевое соединение и работает DNS Но тк не знаю что писать как шлюз для винды ничего не пингуется - "Сеть недоступна".

SVH
() автор топика

sample:

# for cdrom use               
# -cdrom /dev/scd0 (or your cdrom device)                                         
qemu -net nic -net tap,script=./iface-up -k ru -monitor stdio -boot c win98.qemu



$ cat iface-up 
#!/bin/bash

# Host computer IP on eth0: 172.16.1.1
# Host computer IP on tap0: 192.168.1.1
# Guest computer IP on the only interface: 192.168.1.2

# In win98 set:
# ip: 192.168.1.2
# mask: 255.255.255.0
# gw: 192.168.1.1
# dns: 172.16.1.123 (or any dns server, for example, from inet prov)

ifconfig $1 192.168.1.1
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F FORWARD
iptables -P FORWARD ACCEPT
iptables -F -t nat
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.2 -j SNAT --to-source 172.16.1.1

theserg ★★★
()
Ответ на: комментарий от SVH

Всё вроде как надо настроено. Хосты даже могут попинговать друг друга. DNS висит на 127.0.0.1 и его гостевая OC не видит (там указан 198.163.1.1) . Хотя везде доступ разрешил.

SVH
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.