Solved

Advanced Policy Firewall localhost forwarding

Posted on 2013-06-24
3
363 Views
Last Modified: 2013-06-25
I am semi-familiar with advanced policy firewall (APF) routing chains, however I am having issues writing a rule to forward port localhost:139 to 10.0.0.1:139

I'm not sure where to put it. In the preroute, or postroute file?

I basically want something like:

$IPT -t nat [output?] -p tcp --dport 139 -d 127.0.0.1 -j DNAT --to-destination 10.0.0.1:139

Any advice?

Thanks!!
0
Comment
Question by:dr34m3rs
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
Vijay Pratap Singh earned 500 total points
ID: 39273695
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $srcPortNumber -j REDIRECT --to-port $dstPortNumber

#iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2525
0
 
LVL 1

Author Comment

by:dr34m3rs
ID: 39273710
I'm using APF, which is a configuration script for iptables, your examples don't work unfortunately.

$IPT -t nat -A PREROUTING -p tcp --dport 139 -i lo -j DNAT --to-destination 10.0.0.1:139
0
 
LVL 1

Author Comment

by:dr34m3rs
ID: 39276929
Ok after a lot of reading and such, I've discovered that this line of thinking is ridiculous. Although it seems "so simple" of an idea, it just isn't.

I've gone the SSH local to remote forwarding route:

Generating an SSH key with openssh, so I can login to localhost without a password, then using screen to forward my ports (so I can close the console window), and will have to use netcat to forward my UDP ports.

Thanks for the help.

I'll give you the points just because you tried!!

dr34m3r
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question