LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2016, 07:21 AM   #1
linson_85
Member
 
Registered: Oct 2008
Location: Latitude= 9.9722, Longitude= 76.378
Distribution: Open VZ,fedora & Centos
Posts: 47

Rep: Reputation: 0
Allow incoming and block Outgoing - iptables


I'm trying to setup following scenario.

Allow incoming ssh & http requests and block all outgoing traffic on the server.

Chain INPUT (policy DROP)
target prot opt source destination

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 state NEW,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 state NEW,ESTABLISHED

Chain FORWARD (policy DROP)
target prot opt source destination

Chain OUTPUT (policy DROP)
target prot opt source destination

This is used for generating timeout response from web server. But using above rules, cannot make connections to the server via SSH or HTTP as it seems using policy 'iptables -P OUTPUT DROP' is blocking all the incoming connections as well.

It would be of great help if someone could comment on this.
 
Old 02-19-2016, 09:05 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,613

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
 
  


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
Open outgoing / block incoming JJJCR Linux - Security 6 12-22-2014 05:15 AM
[SOLVED] Block outgoing for particular user at particular time using iptables nitya Linux - Newbie 9 02-21-2013 09:11 PM
How to let incoming and outgoing in iptables revinking Linux - Networking 1 08-03-2008 08:35 AM
drop incoming/outgoing packets using iptables doshiaj Linux - Security 1 06-08-2004 11:38 AM
Block incoming port Iptables cli_man Linux - Networking 5 08-11-2003 09:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration