HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- port forwarding with iptables
Operating System - Linux
1834463
Members
2266
Online
110067
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 07:18 AM
09-25-2002 07:18 AM
port forwarding with iptables
i have setup linux box with redhat 7.2 as a router. it has 2 nics, eth1 is the net nic and eth0 is the lan nic.
im running an ftp on a machine on the lan but i also want it to be available through the net. so i just want to forward the port from the router to the internal machine. and i havent been able to get an iptables rule(s) setup to do it. i also chose to accept connections be default and only drop those connections to specific ports that i choose, rather than close everything and only open those that i chose....
heres what i tried
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to-dest 192.168.1.10:21
iptables -A FORWARD -p tcp -i eth1 --dport 21 -d 192.168.1.10 -j ACCEPT
i dont think i should need the second line since i have chosen to accept all connections except those speicified, but i figured it was worth a shot anyway...
anyone have any ideas?
im running an ftp on a machine on the lan but i also want it to be available through the net. so i just want to forward the port from the router to the internal machine. and i havent been able to get an iptables rule(s) setup to do it. i also chose to accept connections be default and only drop those connections to specific ports that i choose, rather than close everything and only open those that i chose....
heres what i tried
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to-dest 192.168.1.10:21
iptables -A FORWARD -p tcp -i eth1 --dport 21 -d 192.168.1.10 -j ACCEPT
i dont think i should need the second line since i have chosen to accept all connections except those speicified, but i figured it was worth a shot anyway...
anyone have any ideas?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 01:53 AM
09-26-2002 01:53 AM
Re: port forwarding with iptables
Hi,
ftp is a specific protocol, because it's storing in the datas during connection the port on each side to established data tranfer.
the ftp-data (port 20) is also used !!
There's a passive mode which permit to avoid the port in data described bellow.
THe best thing is to authorize to go outside any ports gt 1024, and inside the port 20.
If you need ftp from both side, then you will have to open much more other ports.....
See your deny tcp packets from the log to see all what is needed when you try an ftp session...
hope it will help
Benoit
ftp is a specific protocol, because it's storing in the datas during connection the port on each side to established data tranfer.
the ftp-data (port 20) is also used !!
There's a passive mode which permit to avoid the port in data described bellow.
THe best thing is to authorize to go outside any ports gt 1024, and inside the port 20.
If you need ftp from both side, then you will have to open much more other ports.....
See your deny tcp packets from the log to see all what is needed when you try an ftp session...
hope it will help
Benoit
Une application mal pansée aboutit à une usine à gaze (GHG)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 09:12 AM
09-26-2002 09:12 AM
Re: port forwarding with iptables
where would i find the logs for my tcp connections? i looked and couldnt find anything....but im not exactly sure what file(s) im looking for...
thanks for the help
thanks for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2002 04:42 PM
09-27-2002 04:42 PM
Re: port forwarding with iptables
boooo, (kinda cool moniker...)
the log in question would be
/var/log/messages
unless you've set up your iptables to log elsewhere.
It might be instructive to run a packet sniffer (like ethereal) to watch what happens on the interfaces when ftp connections are attempted.
Best Regards,
Mark
the log in question would be
/var/log/messages
unless you've set up your iptables to log elsewhere.
It might be instructive to run a packet sniffer (like ethereal) to watch what happens on the interfaces when ftp connections are attempted.
Best Regards,
Mark
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP