01 Oct, 2012, Hades_Kane wrote in the 1st comment:
Votes: 0
This is what I used to forward from port 23 to 4000, to open up that port for people who are limited by firewalls.

/sbin/iptables -t nat -A PREROUTING -p tcp –dport 23 -j REDIRECT –to 4000

It seemed to be working fine, but I noticed today that it wasn't. I typed it in as root again and BAM, back to normal.

Is there something else I need to do to save this, or any idea on why it mighta stopped working?
02 Oct, 2012, Davion wrote in the 2nd comment:
Votes: 0
Hades_Kane said:
This is what I used to forward from port 23 to 4000, to open up that port for people who are limited by firewalls.

/sbin/iptables -t nat -A PREROUTING -p tcp –dport 23 -j REDIRECT –to 4000

It seemed to be working fine, but I noticed today that it wasn't. I typed it in as root again and BAM, back to normal.

Is there something else I need to do to save this, or any idea on why it mighta stopped working?


iptables rules do not save through reboot. So if you've rebooted then it'll disappear. I don't think iptables comes with a config file by default, but you might wanna try adding an /etc/iptables.cnf and use iptables-save/iptables-restore in an init.d script to maintain it.

If you want something more portable, you can add something to your startup script that tests if the rule is there, if not, insert it. Then boot the MUD. You can just insert it every time the script boots up, but I think iptables will just let you stack the same rule over'n over. Honestly, no idea what that'd do :D
02 Oct, 2012, Hades_Kane wrote in the 3rd comment:
Votes: 0
I'm gonna try this, hopefully it'll work:

http://www.debian-administration.org/art...
02 Oct, 2012, Hades_Kane wrote in the 4th comment:
Votes: 0
Didn't work.
02 Oct, 2012, Hades_Kane wrote in the 5th comment:
Votes: 0
Ok, this one looks closer to what you mighta been talking about, Davion…

http://www.perkin.org.uk/posts/iptables-...

Problem is, I'm really quite a noob when it comes to shell stuff like that, I had a lot of help setting up my VPS originally, so I'm not entirely sure what I'm doing here.


iptbl  -A INPUT -p tcp -m tcp –dport 22   -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 25 -j ACCEPT
ip4tbl -A INPUT -p tcp -m tcp –dport 53 -s 85.158.46.77 -j ACCEPT
ip4tbl -A INPUT -p udp -m udp –dport 53 -s 85.158.46.77 -j ACCEPT
ip4tbl -A INPUT -p tcp -m tcp –dport 53 -s 193.108.199.128 -j ACCEPT
ip4tbl -A INPUT -p udp -m udp –dport 53 -s 193.108.199.128 -j ACCEPT
ip4tbl -A INPUT -p tcp -m tcp –dport 53 -s 193.108.199.130 -j ACCEPT
ip4tbl -A INPUT -p udp -m udp –dport 53 -s 193.108.199.130 -j ACCEPT
ip4tbl -A INPUT -p tcp -m tcp –dport 53 -s 213.5.89.46 -j ACCEPT
ip4tbl -A INPUT -p udp -m udp –dport 53 -s 213.5.89.46 -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 113 -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 465 -j ACCEPT
iptbl -A INPUT -p tcp -m tcp –dport 993 -j ACCEPT


That bit there I am assuming is stuff specific to his script. I would assume this is where I would put my

/sbin/iptables -t nat -A PREROUTING -p tcp –dport 23 -j REDIRECT –to 4000

But I'm not really sure.

Any suggestions on the proper way I ought to modify this would be IMMENSELY helpful. Also, at the bottom he says "Just remember to make it executable ;-)" but I'm not entirely sure what he means by that or how to do it.

Thanks in advance!
02 Oct, 2012, Hades_Kane wrote in the 6th comment:
Votes: 0
Found another I'm going to try :p

http://wiki.debian.org/iptables
03 Oct, 2012, Sharmair wrote in the 7th comment:
Votes: 0
I would assume by making it executable it is meant to make sure it is chmod'ed to be
runable, like your startup script or your MUD.
Anyway about your port issue, is there some reason you don't do it right and have
the MUD listen on 23? If you have no idea how to have the MUD listen on multiple
ports, you might want to look at SMAUG, it listens on 4 ports, though the code is
pretty trivial, just a couple extra lines.
03 Oct, 2012, Hades_Kane wrote in the 8th comment:
Votes: 0
Sharmair said:
Anyway about your port issue, is there some reason you don't do it right and have
the MUD listen on 23? If you have no idea how to have the MUD listen on multiple
ports, you might want to look at SMAUG, it listens on 4 ports, though the code is
pretty trivial, just a couple extra lines.


As far as I knew, the only way to make it catch multiple ports would be port forwarding. I'll look at SMAUG and see if that would be a better solution.
03 Oct, 2012, Hades_Kane wrote in the 9th comment:
Votes: 0
Is it this stuff in comm.c?

control  = init_socket( port   );
control2 = init_socket( port+1 );
conclient= init_socket( port+10);
conjava = init_socket( port+20);
03 Oct, 2012, Hades_Kane wrote in the 10th comment:
Votes: 0
Hades_Kane said:
Found another I'm going to try :p

http://wiki.debian.org/iptables


After a lot of help from some of my pbase, the steps in here got it working!
03 Oct, 2012, quixadhal wrote in the 11th comment:
Votes: 0
Glad you got it working. I'd have just set up a dedicated firewall machine from the junkyard running ZeroShell.

Much easier thank mucking about with iptables directly, and it runs nicely on an old P3 with a little USB thumb drive, so it's very quiet and doesn't draw much power.
0.0/11