G3sNetRamblings

From PearPC

Revision as of 15:26, 7 February 2006 by AlexExtreme (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A couple of months ago I (Guru3) wrote down everything I could think of about networking. Here, my friends, are the results of that splurge... I hope this helps people...

PearPC Networking (Windows)

Having been working with PearPC for about 4 months now, reading the pearpc.net forums, participating in #pearpc irc, and reading the developers mailing list, I've come across almost everything there is to networking and I've decided it's time to try and share some of this knowledge. I may actually be quite technical, so this is not for the faint of heart. Nor, is this an idiots guide to getting networking to work correctly. This is an indepth assortment of what does, and does not work, as of PearPC 0.3.1 official with a mention or two of 0.4pre. I'm going to outline everything I've ever tried with networking basically, and hope it helps someone. Well, I'm not the best writer, so read it to find out what's really here... Also I might add, I'm leaving out linux as frankly, I just haven't pissed around with that as much. One last thing- I've only dealt with OpenVPN 2.0 Beta2 and Beta11, as these have seemed to me the only viable options in this area.

So, let the games begin. First I'd like to say that there is a difference, however under noticed it is, between getting networking and internet working inside of PearPC. The latter is not synonymous with the former, although it requires it. Simply stated, networking is communication between your PC and PearPC, while internet is getting PearPC to have internet access. Having networking without internet can actually be useful. I've used that many a time to get files in and out... After all, why should I need to browse the internet in PearPC when I can do that on my PC? OK, there is the random time where it would come in handy, but I'll tell you about that later. For now, just know there's a difference, and when I speak of networking I don't mean internet, when I mean internet, I'll say internet.

Networking is actually just about fool proof, because it requires no special briding or anything of that sort. Just have the TAP device set with a static ip, say aaa.bbb.ccc.dd1. Then, set the IP inside the client os (the os inside PearPC) to aaa.bbb.ccc.dd2. Then watch amazed as you can ping aa.bbb.ccc.dd1 from inside PearPC. If that doesn't work... Check to make sure that you're using the proper version of OpenVPN, ie, Beta11 does not mix with 0.2, while it does with 0.3. Most normal people would only use the newest version of PearPC; however, I will cover information for the older versions too (I hope, depends on what I remember to do...).

What can you do with just networking then? Mainly swap files between your PC and PearPC, hardly ever useful, but you never know. How I do it is I run a simple FTP server on my desktop and simply upload/download from it. Although I should mention for some reason the last time I tried this, downloading a file larger than 2 megabytes crashed the whole thing... Maybe it was something with the FTP server. I'd imagine, though I haven't tried (cause I haven't needed) that smb would work equally well. smb is windows file sharing, fyi. But, this isn't about moving files around, it's about actual communication.

Getting internet in PearPC thought, that's trickier. Much trickier. For some reason, I'd estimate this only works 40% of the time for me, for some, stupid reason. At least, that's my personal experience. I'll also say straight out, that it worked a lot better with 0.2.0 then it has been with 0.3.x. But that aside, there are 3 main ways of getting the internet into PearPC. There's bridging. internet connection sharing (ICS), and the proxy method. Bridging is available to XP only, ics to 2000 and up, proxy however is for all.

Briding is relatively straight forward. You've got your tap device selected and your lan connection selected and you click bridge connections... The bridge gets a new IP, so watch out for that, but when you start up pearpc, you should get an ip off your lans DHCP. Of course, that's how it's supposed to work... It's only worked perfectly for me in 0.2.0... In more recent versions, it's been flickering on & off randomly... Maybe that's just my copy of XP acting up (SP1). I've heard it works well for others tho, so, I'll test this more on other copies of XP eventually. But hey, if it works, that's very good. A few hints on setting things up & what not. You don't bridge if your other connection is direct to the internet, that's what ICS is for. If your computer runs ICS and you want to bridge, un ICS, bridge your lan and tap, then enable ICS for the bridge- I've heard this works. Quickly going back to it not working in 0.3+, this is just the bridging, other methods still work.

ICS is probably the best, provided you're not already on an ICS lan like I'm on. If you're already ICSing, read what I said about that the paragraph before & whatnot. Other then that it's pretty straight forward to enable ICS on your lan connection, and make sure the tap is set to 192.168.0.1. PearPC should pick up an 192.168.0.x ip from DHCP then, with gateway 192.168.0.1, and off you go. Not many exceptions to this rule. Just if you're already on an ICS lan, you can't use it, so you have to try bridging or the proxy method.

The proxy method prasys and I came up with about the same time... How it works is very simple, you get a free proxy server like AnalogX Proxy, or a shareware one CCProxy, install it. Then you set the taps IP to 10.0.0.1 or some such address, and then PearPCs IP to 10.0.0.2 or, the last address + 1. Then set up your client OS to use a proxy, and viola! This most fullproof method, though unfortunately it is the most restrictive also. I should mention that AnalogX Proxy, while simple, has a bit of overhead, so if you're on a slower machine, you should probably use CCProxy. CCProxy also supports Socks 5, so it's a bit less restrictive that way.

Well, that's it for now... I'll of course keep on trying stuff and update this or post amendments of something, but that's everything I can think of right now. Oh, one thing, I speak of PearPC like it's an OS sometimes, that's usually referring to the guest (client) OS inside of PearPC. I hope you all liked this and what not, feed back welcome, etc, etc...

Guru3

Addendum

ERROR I've been sitting on this over a month now, thinking things over, and I've learned a bit more in that time. First, watch out for firewalls. I've seen definitive evidence that things like Zone Alarm interfere with ICS. With the whole issue of bridging not working with 0.3.x later, I've seen another report or two with bridging not working when it used to. I've also realized that I haven't much touched on client operating systems besides OS X. I sucessfully got networking working with Darwin 7.0.1, using the RealTek adapter. Darwin doesn't include a web browser so I manually compiled lynx as a browser. I did this it seems with the briding method, in 0.3.1. Definetely harder than the average networking. With linux as the client os, I've heard of one report where someone got the module for the RTL8139 device to load correctly, but they got no farther. Personally, the module wouldn't even load for me.

I don't know how this escaped me before, but with just referring to the RTL8139 there, I just realized that I haven't mentioned anything about the different devices that PearPC can emulate for the client os. First, it doesn't matter what physical hardware you have, PearPC will work the same regardless. Second, I only remember two or three reports of the 3C905x working with a Windows host, so stick to the RTL8139. The downside of that is that only OS X 10.3/Darwin 7.0.0/Linux includes drivers for that device. RTL has a driver for OS X 10.1/10.2, but it has not worked for anyone. So if you're desperate in 10.1/10.2, try the 3C905x and let me know if it works for you, I'd be more interested in feedback on this. Do note that it requires a driver downloadable from the PearPC homepage. Another note on versions, if you're using PearPC 0.3.x or later, any version of OpenVPN 2.0 is ok, but 0.2.0 or earlier must have 2.0 beta2.

A wee note on bridging, if you get the "[io/rtl8139] <warning> internal buffer wrapped around", and nothing else in your console, it's 95% of briding not working. It can ocaisonally be caused for the reason it's supposed to be during normal operation, but it's slim. [edit by infirmus] I have seen this error due to bridging myself in 0.3.1. It only happens to my setup when the bridging is done before pearpc is started. If I start pearpc and let osx boot up, THEN bridge my connections, everything works fine and I can access other computers on my LAN as well as my router [/edit]

Well, I'm sure this won't be the last update as I continue to remember more things, or just plain ole' find more out. And again, any input at all is welcome, and good luck with your networking.

Guru3