LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-21-2015, 02:42 AM   #1
Chris_Unknown
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Rep: Reputation: Disabled
SNAT not working - What am I doing wrong?


Hi everyone!

I have a very strange problem that I'm currently working on.
Let me explain the situation to you:

Network diagram:


External PC -> IP: 82.12.5.1 -> Eth0
Debian Apache Server -> 192.168.5.147 -> Eth1
Internal PC -> 10.10.5.10 -> Eth2

They are all separated through a Linux Firewall (Debian 5).

Debian Apache
-
-
-
eth1
External PC ------ eth0 --- Debian FW --- eth2 -------- Internal PC

I want to setup up SNAT in the way that the Internal PC is sending packets with the source IP of eth1 (192.168.5.1).

Following rules are applied:

iptables input, forward and output are all open (default ACCEPT)

SNAT Rule:

iptables -t nat -A POSTROUTING -s 10.10.5.10 -j SNAT --to-source 192.168.5.1
iptables-save

Basically this should work right?

If not -> What am I doing wrong?

Christian

Last edited by Chris_Unknown; 01-21-2015 at 02:43 AM.
 
Old 01-21-2015, 07:14 AM   #2
Chris_Unknown
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Nobody?
 
Old 01-21-2015, 12:22 PM   #3
Chris_Unknown
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
ok i solved it - but to be honest -> Have no idea why it is working now!
I changed the host IP address that should be NAT to the complete scope.
Don't know why it is working now!
Any Explanation?

Further comments: I changed the communication path from the external pc to the Apache webserver instead from the internal one to the webserver --- could this make any difference?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
iptables postrouting SNAT not working - what am I doing wrong? web_janitor Linux - Networking 19 03-18-2024 12:01 PM
IPtables: SNAT not working batman2277 Linux - Security 8 08-31-2012 02:44 PM
SNAT with virtual interface not working rajat83 Linux - Networking 1 08-13-2008 11:34 PM
SNAT and DNAT on same firewall machine not working gugabaga Linux - Networking 2 02-06-2006 06:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:51 AM.

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