LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-31-2021, 05:48 PM   #1
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Add a masquerading source NAT rule that forwards traffic from your router port to the WAN connection


Can someone give me an iptables example of what it should look like? Thanks
 
Old 04-01-2021, 02:07 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
From the MASQUERADING HOWTO:
Code:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 123.12.23.43
EDIT: I am not sure how a source NAT rule can forward traffic, to be honest. My answer is probably not helpful.

Last edited by berndbausch; 04-01-2021 at 02:13 AM.
 
Old 04-03-2021, 09:10 PM   #3
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
This is what I'm trying to accomplish, but don't know how to put it in iptables format.

1.) a firewall rule to permit inbound traffic on port 12345
2.) a destination NAT rule for inbound traffic doing the forwarding configured above
3.) usually uses a default system-wide source NAT rule for outgoing traffic that specifies IP-masquerading
 
Old 04-04-2021, 01:19 PM   #4
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
This is what I'm trying to do with iptables

external public ip:34000 TCP redirected to internal 192.168.0.12:34000


I have tried dnat snat forward etc... Its not working for me.

Last edited by PROBLEMCHYLD; 04-04-2021 at 01:59 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple port forwards with same router ipaddress mlnm Linux - Newbie 1 08-09-2011 06:01 PM
WAN port of WLAN router as uplink to another router isync Linux - Networking 2 05-30-2010 07:53 AM
Linksys router forwards no ports to Fedora box unknownmosquito Linux - Networking 5 10-26-2007 03:16 PM
LXer: AT&T Forwards ALL Internet Traffic Into NSA Says EFF LXer Syndicated Linux News 0 04-06-2006 11:21 AM
FreeS/Wan Vs. OpenS/Wan Vs. StrongS/Wan bkankur Linux - Security 1 03-01-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration