How to setup network

PearPC contains emulation of the 3Com 3c90x and the RealTek 8139 network cards. It needs TUN (Ethernet IP tunnel) support in your operating system. This currently works on Linux and Windows platforms. (Reportedly also on FreeBSD)

  • Networking on Linux hosts only works when executed from a compiled source tree (as opposed to an installed version).
  • Networking globally sets IP forwarding. This is bad and subject to change.

Generic host setup

This varies from installation to installation. If you have a decent installation you'll most likely already have everything setup perfectly. Currently only systems providing TUN network interfaces through the device /dev/net/tun are supported.

Currently really only Linux hosts are supported. Read linux host setup then come back here.

PearPC will create a new (TUN) network interface called ppc which will be used to connect the client to the host network. We will then (globally, subject to change) enable IP forwarding to allow IP packets to jump between interfaces. And finally enable NAT to allow these packets to return to the client.

You must choose a free subnet that PearPC should operate on. This subnet should not be used on your computer or the rest of the network that you are working with (like eg. the Internet!). The client and the host each must get an exclusive (ie. NOT the same!) IP address within that subnet.

Please change to the PearPC source directory now.

The values for the subnet's net mask, host and client IPs must be set in scripts/ifppc_up. Most people can use the default setup:

Default network setup in scripts/ifppc_up:
    		PPC_NETMASK   = "255.255.255.0"
		PPC_HOST_IP   = "192.168.1.80"
		PPC_CLIENT_IP = "192.168.1.1"
	
Next you must make sure the programs setting up networking have the correct permissions. Make sure you have compiled PearPC at this point. Execute this in the scripts/ directory (as user root!):
		# chmod a-w ifppc_up ifppc_down ifppc_up.setuid ifppc_down.setuid
		# chown root ifppc_up ifppc_down ifppc_up.setuid ifppc_down.setuid
		# chmod u+s ifppc_up.setuid ifppc_down.setuid
	

Now enable networking support in your configuration file and launch PearPC. Then read about generic client networking setup. Have a lot of fun!

Linux host setup

For Linux 2.4.x: You must enable (as a module "M" or compiled-in "Y") the following features in your kernel:
  • "Network Device Support / Universal TUN/TAP device driver support" (CONFIG_TUN)
  • "Network Options / Network Packet Filtering (replaces ipchains)" (CONFIG_NETFILTER)
For Linux 2.6.x: You must enable (as a module "M" or compiled-in "Y") the following features in your kernel:
  • "Device Drivers / Networking support / Universal TUN/TAP device driver support" (CONFIG_TUN)
  • "Device Drivers / Networking support / Networking Options / Network Packet Filtering (replaces ipchains) / IP: Netfilter Configuration / Connection tracking (required for masq/NAT)" (CONFIG_IP_NF_CONNTRACK)
  • "Device Drivers / Networking support / Networking Options / Network Packet Filtering (replaces ipchains) / IP: Netfilter Configuration / IP tables support (required for filtering/masq/NAT)" (CONFIG_IP_NF_IPTABLES)
  • "Device Drivers / Networking support / Networking Options / Network Packet Filtering (replaces ipchains) / IP: Netfilter Configuration / MASQUERADE target support" (CONFIG_IP_NF_MASQUERADE)

No support for other Linux kernels.

If you have configured any of the above kernel features as a module make sure they are loaded before starting PearPC.

You must have the iptables package installed. (you need the program named "iptables")

Windows host setup

There's now support for networking on Windows host systems. Please refer to PearPC.net ("Guides") for more information.

Generic client setup

On most systems you can simply execute:

	
		# /sbin/ifconfig eth0 $PPC_CLIENT_IP netmask $PPC_NETMASK up
		# route add default gw $PPC_HOST_IP
	
Where $PPC_CLIENT_IP, $PPC_NETMASK and $PPC_HOST_IP should be replaced with the values chosen during Generic host setup. For Linux hosts enable the 3c90x. You may then have to load a 3c90x network card driver. (modprobe 3c59x)
For Mac OS X hosts enable the RTL 8139. It should be automatically detected.


All trademarks are properties
of their respective owners.
Copyright © 2003-2006 Sebastian Biallas
Artwork by Stefan Weyergraf