As a repeater of this separate topic, I upload the patch here.
Basically, neozeed started with SLiRP redirections (or port forwarding) in order to make guests visible from the host. His contribution was put hardcoded for testing, so I thought it would be a good idea to move the port forwarding entries to the machine-specific config file.
After a bit of work, I got it working for both TCP and UDP, using the following proposed notation (omit the comments if copying):
Code: Select all
# Inside a machine-specific config file, put this group.
[SLiRP Redirects]
# Use this to enable/disble port forwarding. "0" disables, "1" enables.
enable = 1
# From here, the notation in use is as follows: connection_type.host_port = guest_port
# It reads: forward any packages from the specified host port that are a certain type into the given guest port.
# Following are the examples *neozeed* initially hardcoded.
tcp.42322 = 22
tcp.42323 = 23
tcp.42380 = 80
tcp.42443 = 443
udp.2213 = 2213
udp.2231 = 2231
udp.2271 = 2271
Any comments or questions regarding this patch are welcome.
Regards! :3