Skip to contentSkip to conversation

TUN settings

Qemu-devel Hetz Ben Hamo 3 participants 4 messages Jun 7, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

Since SLiRP seems to not work with the PCI NE2000 here (4 machines, different configurations, none of them work), I decided to try the TUN way..

Here's my /etc/qemu-ifup script (based on what Tim posted):

!/bin/sh sudo /sbin/ifconfig tun0 192.168.2.200 netmask 255.255.255.0 broadcast 192.168.2.255
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

(it's 2 lines, kmail breaks them...grrr)

In Windows 98 guest the config is:

IP Address: 192.168.2.201
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.2.200

And yet, I cannot ping the TUN interface in the host (192.168.2.200), and I cannot ping anywhere else.

Suggestions?

Thanks,
Hetz

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hetz Ben Hamo wrote:
| And yet, I cannot ping the TUN interface in the host (192.168.2.200), and I
| cannot ping anywhere else.
I have problems with usermode networking and tun networking too...

- --
Pozdrowienia
Adrian Smarzewski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAxD+tgnuWEmthbpURAvnxAJ9QNJc0AFeRUiskemsykyoHFjrY+gCeO/oP lVbvdVBxr17uPSG5SoWSanQ=
=mQ5L
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Hetz Ben Hamo
Quoted 5 lines

Here's my /etc/qemu-ifup script (based on what Tim posted):

!/bin/sh sudo /sbin/ifconfig tun0 192.168.2.200 netmask 255.255.255.0 broadcast 192.168.2.255
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

on the first line... shouldn't that be broken into two? making it look something like:

#!/bin/sh
sudo /sbin/ifconfig tun0 192.168.2.200 netmask 255.255.255.0 broadcast 192.168.2.255 sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'

Quoted 2 lines

And yet, I cannot ping the TUN interface in the host (192.168.2.200), and I cannot ping anywhere else.

You probably know all of these things, but it doesn't hurt to check:

- Your qemu-ifup script is executable by your user, yes?
- /dev/net/tun exists (`MAKEDEV tun' has been run in /dev ??)
- /dev/net/tun is writable by your user?
- Your host OS's real ethernet card is configured to a different network than tun0, right? You aren't going to be able to route (and ping may not even work) if you set tun0 and the guest OS to an IP in the same network range that your real NIC is a part of.

When QEMU is running, does ifconfig report the correct settings for tun0?

pardon me if this stuff is obvious to you,
tim

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim wrote:
| You probably know all of these things, but it doesn't hurt to check:
yes and the most important thing is that qemu does not report any errors and I think it should if anything is wrong. Simply no communication. In usermode I can ping the host and that's all. Tun-networking doen't work at all. VMWare works in the same configuration. Kernel 2.6.5 with some gentoo patches. Should I try vanilla kernel sources?

- --
Pozdrowienia
Adrian Smarzewski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAxL6RgnuWEmthbpURAiIrAKCPFsze6eK+7m66NW3zg9tYogZEZwCePSqU 3l1/cp+c/swT7PpBKP0Qd7c=
=7vyY
-----END PGP SIGNATURE-----