Back to RPCEmu Networking Guide
Linux - IP Tunnelling
Known Issues
- ShareFS will not work due to requiring fowarding of UDP broadcast packets.

Set up the forwarding rules for the TAP device that will be created by RPCEmu:
Determine the name of the network interface you want to forward data through: 'ifconfig -a' will list all the network interfaces on your system.
Select the interface that is providing your LAN connection, this is typically eth0 (the common name for the first wired adapter in your machine).
With 'root' privileges type the following commands (replace eth0 with the selected network interface):
iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -t nat -A POSTROUTING --source 172.31.0.0/16 -o eth0 -j MASQUERADE sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv4.ip_dynaddr=1
These commands will enable packet forwarding out of the selected networking interface.
Note that for the moment ShareFS won't work since it'll need some more iptables rules to forward UDP broadcasts (ports 32770/32771/49152/49171) from the host.
RPCEmu Configuration
Run RPCEmu and open the networking configuration GUI (Ctrl-End, Settings -> Networking).

Select the 'IP Tunnelling' option. Enter the IP Address for the host end of the tunnel, in the example network described this is '172.31.0.1', and click OK. RPCEmu will reset. Due to the privileges issue mentioned above you should quit and restart RPCEmu as you no longer have root privileges.
Verifying the configuration
Run RPCEmu and type in one ofthe following commands on Linux:
ip address show dev tap0
Or, on older Linux versions;
ifconfig tap0
The output should be similar to the following:
tap0 Link encap:Ethernet HWaddr 00:ff........... inet addr:172.31.0.1 Bcast:172.31.255.255 Mask:255.255.0.0
Next try to ping the interface:
ping 172.31.0.1
The output should be similar to the following:
PING 172.31.0.1 (172.31.0.1) 56(84) bytes of data. 64 bytes from 172.31.0.1: icmp_seq=1 ttl=64 time=0.079 ms 64 bytes from 172.31.0.1: icmp_seq=2 ttl=64 time=0.069 ms