Port forwarding in Sheepshaver

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Port forwarding in Sheepshaver

Post by MarisaG »

I had this working before, but in a new Sheepshaver installation I am getting warnings when starting up sheepshaver with a config line:
redir tcp:22:51.222.85.183:22
I get a warning of:
could not set up port forwarding rule 'tcp:22:22.51.222.85:22'
Any idea what's going on? I'm running as root as I need to open low ports (below 1024) so that smtp and telnet can come in...

Edit: It's definitely a low-port issue as binding to ports over 1024 works fine...
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
User avatar
Cat_7
Expert User
Posts: 6557
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Port forwarding in Sheepshaver

Post by Cat_7 »

Is that SheepShaver the only application trying to use port 22? Or do you already have something running that uses that port?

Best,
Cat_7
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Re: Port forwarding in Sheepshaver

Post by MarisaG »

Cat_7 wrote: Tue Mar 24, 2026 6:11 am Is that SheepShaver the only application trying to use port 22? Or do you already have something running that uses that port?
Good suggestion, but nothing is using it. Same for port 25...
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
User avatar
Cat_7
Expert User
Posts: 6557
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Port forwarding in Sheepshaver

Post by Cat_7 »

How come you use redir tcp:22:51.222.85.183:22
and not redir tcp:22:10.0.2.15:22

As the redir is only useful when using slirp networking that sets the ip address to 10.0.2.15

To me it looks like you are redirecting directly to your external ip address?

I guess how this should work: redir port 22 from inside SheepShaver to e.g. port 2222 on the host. Then forward port 22 in your router to port 2222 on your host.

Best,
Cat_7
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Re: Port forwarding in Sheepshaver

Post by MarisaG »

Cat_7 wrote: Tue Mar 24, 2026 11:50 am How come you use redir tcp:22:51.222.85.183:22
and not redir tcp:22:10.0.2.15:22
I'm trying to redirect incoming connections on port 22 on ip 51.222.85.183 to sheepshaver also on port 22... It definately is a low port issue as binding to say 5100 doesn't cause a error...
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
User avatar
adespoton
Forum All-Star
Posts: 4727
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

Re: Port forwarding in Sheepshaver

Post by adespoton »

MarisaG wrote: Tue Mar 24, 2026 12:37 pm
Cat_7 wrote: Tue Mar 24, 2026 11:50 am How come you use redir tcp:22:51.222.85.183:22
and not redir tcp:22:10.0.2.15:22
I'm trying to redirect incoming connections on port 22 on ip 51.222.85.183 to sheepshaver also on port 22... It definately is a low port issue as binding to say 5100 doesn't cause a error...
What's your host system? modern macOS, for example, won't let userland processes open low ports. So you can run SheepShaver with sudo, or you can pick a higher port.
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Re: Port forwarding in Sheepshaver

Post by MarisaG »

adespoton wrote: Tue Mar 24, 2026 10:32 pm What's your host system? modern macOS, for example, won't let userland processes open low ports. So you can run SheepShaver with sudo, or you can pick a higher port.
Host is ubuntu 24.04... And I am running it as root so os-wise it should be able to open low ports.
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
User avatar
Cat_7
Expert User
Posts: 6557
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Port forwarding in Sheepshaver

Post by Cat_7 »

Is the IP address of the host the one you are redirecting to? Or is that the address of another machine?

Best,
Cat_7
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Re: Port forwarding in Sheepshaver

Post by MarisaG »

Cat_7 wrote: Wed Mar 25, 2026 5:18 am Is the IP address of the host the one you are redirecting to? Or is that the address of another machine?

It should be the local hosts IP. The same that Sheepshaver is running on. Note I can set up redirs from port 2222 on the local system into port 22 in Sheepshaver and it doesn't complain. Same with 25->2525.
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
User avatar
Cat_7
Expert User
Posts: 6557
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Port forwarding in Sheepshaver

Post by Cat_7 »

Lets recap:

You say you could redirect to the same port number to the host IP address when the port was below 1024 and when running as root.
I feel I should ask again: Are you absolutely sure that used to work?

The working examples you mention all use different ports for origin and destination of traffic.

It looks to me to be a circular definition. You cannot open e.g. port 22 on the host twice. Also, when using slirp networking, the manual says you should enter the ip address 10.0.2.15 in the redirection line (this is where the traffic comes from/goes to) not the ip address of your host.

(earlier on you edited your message: "Edit: It's definitely a low-port issue as binding to ports over 1024 works fine...")
Was this when you redirected to a different port?

edit: a redir line like this: redir tcp:22:192.168.0.15:22 (where the ip address is from my host) does not choke my sheepshaver appimage when I run as root.
So something else might be wrong but I have no idea yet (I haven´t tested whether traffic is actually redirected).


Best,
Cat_7
User avatar
MarisaG
Tinkerer
Posts: 46
Joined: Wed Jul 03, 2019 8:22 am
Location: South San Francisco, CA
Contact:

Re: Port forwarding in Sheepshaver

Post by MarisaG »

Ok I found 2 issues: first was the host name as you mentioned. The other was that I was using port 22 (which is ssh) and not 23 (which is telnet). Changing it to 23 and now connections are being accepted! That's why there was a error trying to bind to that port...

Thanks for your patience!
--- https://MacOS.Retro-OS.live - Portal for classic B&W Macs
--- https://macos.retro-os.live/index.php/firstclass/first-class-server-access - Info on accessing our FirstClass server
--- https://NewtonCity.org - Portal for the Apple Newton PDAs
Post Reply