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 09-25-2014, 05:50 AM   #1
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Rep: Reputation: 2
Help me figure out if these rules are necessary


Network A - Firewall - WebServer (Network B)

I have theses rules:

Code:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 86 -j DNAT --to 192.168.1.56:80

iptables -A FORWARD -s 192.168.1.56 -o eth1 -p tcp --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -d 192.168.1.56 -i eth1 -p tcp --dport 80 -j ACCEPT

iptables -t nat -A POSTROUTING -s 192.168.1.56 -o eth1 -j MASQUERADE
At the bottom of the script, there are rules logging INPUT, OUTPUT and FORWARD, before dropping the packets, and I'm seeing like if I needed to open the port 86 on the firewall itself.

Code:
Sep 25 11:44:01 firewall kernel: INPUT-Drop: IN=eth1 OUT= MAC=... SRC=10.140.1.5 DST=10.140.1.9 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=45454 DF PROTO=TCP SPT=60490 DPT=86 WINDOW=453 RES=0x00 ACK FIN URGP=0
But there are no service listening on port 86. That port is just used to access the web server which is in a VM.

As I cannot test this, because it's a production environment and I need make sure most is going to work before enabling the new configuration, what do you think about that dropped traffic? Is it relevant? I have never seen a packet intended for NAT end up on INPUT.

Last edited by yzT!; 09-29-2014 at 01:24 AM.
 
Old 09-26-2014, 03:23 AM   #2
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Original Poster
Rep: Reputation: 2
I end up quickly adding the drop and checking the application, and it was working so I don't know why the traffic is reaching the end if it's going through PREROUTING
 
Old 09-27-2014, 02:32 PM   #3
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
What you see in the second line of output you posted is the log entry, notifying you of a dropped packet.
It was dropped because it did not match the first rule. It came in through eth1 from 10.140.1.5 (local?) and tried to reach the web-interface of the VM, while the first rule only covers eth0.
It did not go anywhere, as it was dropped.

That is what I see.
 
Old 09-29-2014, 01:24 AM   #4
yzT!
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 168

Original Poster
Rep: Reputation: 2
sorry, that was a mistype. The first rule is eth1
 
  


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
RKHunter ASCII text in /dev/.udev/rules.d/root.rules metrx Linux - Security 2 03-07-2014 08:37 AM
auditctl -l not showing any rules even though i have rules written in audit.rules alphaguy Linux - Security 1 02-07-2014 05:28 PM
Slack 13.1 : /etc/udev/rules.d70-persistent-net.rules Ramurd Slackware 10 02-18-2011 09:56 AM
cat: /etc/udev/rules.d/70-persistent-net.rules: No such file or directory rcg1984 Linux From Scratch 2 09-17-2008 07:02 AM
How to write two snort detection rules to alert on packets to those rules romafiel *BSD 0 06-08-2007 07:00 PM

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

All times are GMT -5. The time now is 01:42 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