LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Qemu with internet... (https://www.linuxquestions.org/questions/linux-software-2/qemu-with-internet-568458/)

Fill 07-11-2007 11:24 AM

Qemu with internet...
 
I've been looking for help about mounting internet on my virtual windows machine that runs under qemu.

I caught this under linuxquestions:

Quote:

Now that Windows is installed, you need to get internet working. It autoconfigures its NIC with a virtual dhcp server with the IP of 10.0.2.5. You need to allow packet flow of that DHCP server, so I put these rules in my iptables config:
Code:

iptables -A FORWARD -d $IP_FROM_CLIENT_OS -j ACCEPT
iptables -A FORWARD -s $IP_FROM_CLIENT_OS -j ACCEPT

$IP_FROM_CLIENT_OS was set to the virtual dhcp server's ip: 10.0.2.5

You'll need to make sure you have the tun/tap kernel module installed. It was, in my kernel, installed as a module by default. So all I had to do was:
Code:

modprobe tun
You now have a /dev/net/tun device, and should have internet.

After that, I reloaded the image.
How do I edit that iptables? I know it is in /sbin/ifconfig, am I right?

Yeah, but when I open it with gedit text editor, I get a message saying that he's uncapable of reading the text codification. How can I edit it?

Tinkster 07-12-2007 04:22 AM

Ummm ... how iptables is handled depends largely on your
distro, as does the way networking between QEMU VMs and
their host is done in general. Shed some light in regards
to your distro, and maybe people can make targeted suggestions.

[edit]
Oh, and in NO distro do you want to edit a binary with a
text editor... IP tables rules are commonly modified with
shell scripts, and again the how depends on your distro...
[/edit]

Cheers,
Tink


All times are GMT -5. The time now is 06:39 PM.