LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-14-2016, 02:03 AM   #16
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11

I understand. My rules my be accept from "nrp.co".
Can you change my iptables that accept below Input and Output :
Code:
Chain INPUT (policy DROP)
ACCEPT     tcp  --  XXXX.nrp.co     anywhere             tcp dpt:domain
ACCEPT     udp  --  XXXX.nrp.co     anywhere             udp dpt:domain
ACCEPT     tcp  --  XXXX.nrp.co     anywhere             tcp spt:domain
ACCEPT     udp  --  XXXX.nrp.co     anywhere             udp spt:domain


Chain OUTPUT (policy DROP)
ACCEPT     tcp  --  anywhere             XXXX.nrp.co     tcp dpt:domain
ACCEPT     udp  --  anywhere             XXXX.nrp.co     udp dpt:domain
ACCEPT     tcp  --  anywhere             XXXX.nrp.co     tcp spt:domain
ACCEPT     udp  --  anywhere             XXXX.nrp.co     udp spt:domain

Chain ALLOWIN (1 references)
target     prot opt source               destination         
ACCEPT     all  --  XXXX.nrp.co     anywhere
My iptables rules are :
Code:
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT

#  Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#  Allows all outbound traffic
#  You can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

# Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 25 -j ACCEPT
-A INPUT -p tcp --dport 21 -j ACCEPT
-A INPUT -p tcp --dport 110 -j ACCEPT
-A INPUT -p tcp --dport 143 -j ACCEPT
-A INPUT -p tcp --dport 465 -j ACCEPT
-A INPUT -p tcp --dport 587 -j ACCEPT
-A INPUT -p tcp --dport 993 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT
-A INPUT -p tcp --dport 995 -j ACCEPT

#  Allows SSH connections (only 4 attempts by an IP every 3 minutes, drop the rest)
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name DEFAULT --rsource
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 180 --hitcount 4 --name DEFAULT --rsource -j DROP
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT

# log iptables denied calls
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Reject all other inbound - default deny unless explicitly allowed policy
-A INPUT -j REJECT
-A FORWARD -j REJECT

COMMIT
Please tell me how can I add Part 1 to my iptables rules.

Tnx.
 
Old 03-14-2016, 11:20 AM   #17
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by hack3rcon View Post
When I did "systemctl stop firewalld && systemctl start iptables && systemctl start ip6tables" my website take down and I must enable "firewalld". What is your idea?
Those commands should have switched you from firewalld to iptables. once that is done you can apply the rules and that should get your web site up and running again.
 
Old 03-15-2016, 01:05 AM   #18
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 11
Thank you so much.
 
  


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
Require iptables rules for web server splinux Linux - Server 7 07-12-2011 05:11 AM
[SOLVED] Linux Router: Iptables rules and dhcp server on eth1 Sum1 Linux - Networking 5 09-25-2009 03:05 AM
iptables rules for an FTP server jsmith6 Slackware 0 07-30-2009 03:58 PM
iptables rules for web server email server,ftp and ssh,please help lightwing Linux - Networking 1 03-25-2009 08:58 PM
Dynamic change of iptables rules using web interface OgeeN Linux - Security 1 09-07-2007 06:03 PM

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

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