?
Solved

Advanced Policy Firewall localhost forwarding

Posted on 2013-06-24
3
Medium Priority
?
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
Vijay Pratap Singh earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

743 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