Solved

Advanced Policy Firewall localhost forwarding

Posted on 2013-06-24
3
357 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Webmin Bandwidth Monitoring not working 10 107
Hardening guide / standard used on ATM machines 4 269
improve Shell script 5 145
is my large folder zipped corrupted 4 51
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now