Networking problems with Embedded version
Forum: DSL Embedded
Topic: Networking problems with Embedded version
started by: Gatorhex
Posted by Gatorhex on Mar. 01 2007,23:36Everyone where I live is fed up of me grabbing their PCs to run Knoppix CD on them to do my linux network programming experiments on.
I thought why not use the embedded version of DSL to run multiple copies direct from the Windows desktop on a single machine.
If I run one copy it works flawlessly even though it sets the IP as 10.0.2.15 and even though my real IP is 192.168.1.14 it accesses the Internet.
What I want to do is run multiple copies and have them talk to each other but when I start a 2nd copy running on the desktop it gets the same IP address. So I change the IP to 10.0.2.16 using the windows tool, but after doing sudo su I cannot ping the first copy.
Is there any way to do this? What am I missing?
Posted by Gatorhex on Mar. 02 2007,00:29Argh! Who moved my post from the networking forum to the embeded forum, I'm sure it's more a networking issue than an embedded one
Posted by ^thehatsrule^ on Mar. 02 2007,00:44afaik qemu just accesses the network like any other app, the "ip" you see is fake.
So this depends on how your network is set up.
If this machine is set up as the host router, I think you can use pseudo network interface tunnels for each connection.
EDIT: just saw your last post, but my post should answer it
Posted by Gatorhex on Mar. 02 2007,00:55if I was on knoppix and it was using a fake IP through NAT i would just go to iptables and turn it off....
but if I go to iptables it's not installed so how is DSL embedded doing the Network Address Translation to get the internet working?
I also tried setting the IP to same as my internal network on 192.168.1.x but all that happened is I lost the internet connection so it is NATing 10.0.2.15 somewhere...
Posted by roberts on Mar. 02 2007,01:01Qemu is providing the network bridge. Qemu provides a DHCP server for such. DSL is only requesting an IP via its pump command.
You should check the Qemu site for Qemu's tun/tap networking support.
Posted by Gatorhex on Mar. 02 2007,01:16Ok, if its using a fake NAT to get on the 192.168 network i could live with that but I don't understand why 2 DSLs can't talk to each other on the fake 10.0 side if they are both in that range
Bah, I give up with it, it's not got iptables and I'll probably need to use that to emulate my firewalls
Posted by Gatorhex on Mar. 02 2007,01:25Just read somewhere....
"In other words, conceptually, tun0 actually sits 'between' the host OS and the guest (whether this is actually the case or not I leave as an intellectual exercise for the reader). So, the tun0 address and the qemu guest OS address should be different, but should both be on the same subnet, and that subnet should be utterly different to anything else on your network. Intellectually I can appreciate the possibility that it shouldn't *have* to be on a different subnet, but in practice I met with utter and complete failure attempting to make tun0 and the guest OS NIC live on the same subnet as all the 'real' NICs.
Therefore, all traffic to the 'real world' goes from the guest, to tun0 (ie, in the guest OS set the address of the default gateway to be the tun0 address), and from tun0 out to the world via the real NIC address. To make all this work, you need a script that puts the house in order for tun0.
Your real NIC, because all of the traffic is routing through it, has to have an appropriate iptables rule to masquerade traffic, and ip forwarding needs to be enabled for the host OS. Here is a simple script that does everything necessary (ie, this is a working, complete qemu-ifup):
iptables --flush #Clear out all previous rules ('/etc/init.d/iptables stop' may also work)
echo 1 >/proc/sys/net/ipv4/ip_forward #Enable IP forwarding for the host OS
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #Enable masquerading on your real NIC so tun0 can get in and out
ifconfig $1 10.0.0.1 #Bring up tun0 on a different subnet from the host
--------8<--------snip" < http://www.arcknowledge.com/gmane.c....65.html >
OMG somone please put iptables into the DSL distro
Posted by roberts on Mar. 02 2007,01:54MyDSL->UNC->rcfilewall.unc
Posted by ^thehatsrule^ on Mar. 02 2007,03:58I think that script is for the host o/s .... and I don't think you are using DSL as the host.
If you want an easy way out, there are several commercial VM software you can use that are packaged quite nicely. I'd suggest trying out vmware (which will set up your host o/s for you)