Port Forwarding SLiRP

Support and general discussion.
Post Reply
MrMe85
Posts: 5
Joined: Sat 28 Nov, 2020 2:03 am

Port Forwarding SLiRP

Post by MrMe85 »

Hi there,

First off, I am new to this forum, and just wanted to say hello to everyone.

Second, I just have a question with the current network implementation in PCem. I've been experimenting with someone online in getting an old game (Mechwarrior 2: Mercenaries) running online via TCP/IP. However, when I connect, it does not take long before I am immediately disconnected. The explanation for this, based on a little reading, is the implementation of SLiRP in PCem for online networking.

Now, I am not very technical, but according to Wikipedia, one of the limitations of SLiRP is that it cannot arbitrarily accept incoming connections with arbitrary connections--unless one uses port forwarding. The question I have is thus: how do I port forward in PCem or is this even possible at the moment?

Thanks in advance for your help.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: Port Forwarding SLiRP

Post by JosepMa »

You can build PCEm with Slirp and also with Pcap. With Pcap you would have a better control since the emulator will have a different IP on your network, rather than doing NAT over your machine's IP.

As for port forwarding, I am not sure if that was implemented. It means that the application (PCem) would open a port on the host machine that would be forwarded to the internal IP and port.
MrMe85
Posts: 5
Joined: Sat 28 Nov, 2020 2:03 am

Re: Port Forwarding SLiRP

Post by MrMe85 »

I guess the problem with using PCAP is that I need to hard wire my machine, or buy some wifi extender that will allow me to wire it in, which is inconvenient. There has got to be a better solution.
DOS
Posts: 10
Joined: Thu 12 Nov, 2020 2:28 am

Re: Port Forwarding SLiRP

Post by DOS »

Hi, fellow new user!

I've never tried SLiRP, but since there haven't been many replies I'll try to answer anyway. I'm not clear on how it works, if the guest tries to listen on a particular TCP port, does SLiRP start listening on that port on the host or not?

If it does then could you just get your host to do port forwarding? I think this is something that both Windows and Linux can do out of the box these days.

If not, maybe you could try this patch to add configurable port forwarding: https://pcem-emulator.co.uk/phpBB3/viewtopic.php?t=3160

As for the Pcap solution, can you get it to use a loopback or TAP adapter? If so, then maybe you could do port forwarding in the host OS as above.
Apologies in advance for not responding, I don't check back here very often.
Post Reply