forwarding ports fc5 for server
i have a 500mhz p3 intel dell computer that is a few years old, but i set it up as my router for my cable modem connection
while everything seems to function correctly, i am unsure how to forward ports for various things (ssh, bittorrent, ftp) ive read a bit of google and i believe you use the iptables to open ports (this is what i did for routing the internet) i am a bit of a newbie, but know some linux please help! thanks, pula |
if you wanna forward ports lookup on iptables -j SNAT / -j DNAT targets
|
Sounds like we have similar configurations. My cable modem plugs into one network interface on my debian box, and my wireless router plugs into the second interface. I believe I could have plugged in the modem directly into the router and had it do all the network address translation, but I run a few servers on the debian box, and I wanted it to have a direct connection. In order to run the box as a full gateway (I think that's what its called), I need to configure iptables and run bind for address resolution.
Here's the shell script that I run to start iptables to forward all ip requests from eth1 (internal LAN) to eth0 (internet). Code:
# Set up IP FORWARDing and Masquerading Code:
apt-get install bind9 In order to directly connect to one of your machines on the internal network from the internet, you'll have to forward a port on the gateway machine. The easiest way to do this is with SSH. "man ssh" for the details. Here's what I used the other day to connect to my OS X laptop from the internet through my LAN: Code:
# from the gateway machine: This is perhaps the most useful networking cruft that I know about linux. -dave |
maybe this will help the both of you
Code:
iptables -t nat -A PREROUTING -p tcp -d 15.45.23.67 --dport 80 \ |
do i have to redo my entire iptable configuration each time i want to forward ports?
|
Quote:
Yes, if incase you are only using iptables to forward ports. Though you can place this script or any script in any of your box's startup scripts to let them activate @ boot & you can also use iptables-save & restore function. Try google them for further details, man page is a nice place to startwith as well. |
All times are GMT -5. The time now is 10:21 PM. |