LinuxQuestions.org
Help answer threads with 0 replies.
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 09-19-2017, 11:26 PM   #16
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,748

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203

Quote:
Originally Posted by mfoley View Post
Code:
num   pkts bytes target     prot opt in     out     source               destination
8        0     0 DROP       all  --  *      *       195.22.0.0/16        0.0.0.0/0           
9        0     0 DROP       all  --  *      *       195.140.0.0/16       0.0.0.0/0           
10       0     0 DROP       all  --  *      *       155.132.0.0/15       0.0.0.0/0           
11       0     0 DROP       all  --  *      *       155.131.0.0/16       0.0.0.0/0           
12       0     0 DROP       all  --  *      *       195.22.0.0/16        0.0.0.0/0           
13       4   160 DROP       all  --  *      *       80.82.65.0/24        0.0.0.0/0           
172      0     0            tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            multiport dports 1901:1914
195.22.126.131 and 155.133.82.18 are new since my last posting and were inserted into the iptables from the script we talked about.

Are we sure the multiport line goes AFTER the DROP?
What is that multiport line supposed to be doing? Since it has no target, the only effect of a packet matching it would be to increment that rule's byte and packet counts. In this particular case, all traffic (4 packets, 160 bytes), from 80.82.65.0/24 has already been dropped regardless of protocol or port (or perhaps ACCEPTed by one of the unseen rules 1-7), so traffic from that source could never reach that multiport rule.
 
Old 09-20-2017, 12:02 AM   #17
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
MORE INFO:

OK, there is definitely something wrong with my iptables script. I've removed the multiport rule for ports 1901-1914 and I'm still getting the attempted breakins. Not only that, but I can access e.g. port 1906 from the outside. Therefore, these ports must be open by default. I don't know how. Here's my iptables script. I've removed the DROPs, but they would go where it says, ">>>> DROPs go here <<<<":
Code:
/usr/sbin/iptables -P INPUT ACCEPT
/usr/sbin/iptables -P FORWARD ACCEPT
/usr/sbin/iptables -P OUTPUT ACCEPT
/usr/sbin/iptables -t nat -P PREROUTING ACCEPT
/usr/sbin/iptables -t nat -P POSTROUTING ACCEPT
/usr/sbin/iptables -t nat -P OUTPUT ACCEPT
/usr/sbin/iptables -t mangle -P PREROUTING ACCEPT
/usr/sbin/iptables -t mangle -P INPUT ACCEPT
/usr/sbin/iptables -t mangle -P FORWARD ACCEPT
/usr/sbin/iptables -t mangle -P OUTPUT ACCEPT
/usr/sbin/iptables -t mangle -P POSTROUTING ACCEPT
/usr/sbin/iptables -t raw -P PREROUTING ACCEPT
/usr/sbin/iptables -t raw -P OUTPUT ACCEPT
/usr/sbin/iptables -F
/usr/sbin/iptables -F -t nat
/usr/sbin/iptables -F -t mangle
/usr/sbin/iptables -F -t raw
/usr/sbin/iptables -X
/usr/sbin/iptables -X -t nat
/usr/sbin/iptables -X -t mangle
/usr/sbin/iptables -X -t raw
/usr/sbin/iptables -P INPUT DROP
/usr/sbin/iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
/usr/sbin/iptables --append FORWARD --in-interface eth1 -j ACCEPT
/usr/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 587 -j REDIRECT --to-port 25
/usr/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1906 -j DNAT --to-destination 192.168.0.52:xxxx
(more like the above)
/usr/sbin/iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
/usr/sbin/iptables -A INPUT -i lo -j ACCEPT
/usr/sbin/iptables -A INPUT -i eth1 -p tcp --syn -j ACCEPT
/usr/sbin/iptables -A INPUT -i eth1 -p udp -j ACCEPT
>>>> DROPs go here <<<<
/usr/sbin/iptables -N logdrop
/usr/sbin/iptables -A logdrop -j LOG --log-level 6 --log-prefix SSH Break-in attempt 
/usr/sbin/iptables -A logdrop -j DROP
/usr/sbin/iptables -N checkcount
/usr/sbin/iptables -A checkcount -m recent --set
/usr/sbin/iptables -A checkcount -m recent --rcheck --hitcount 12 -j logdrop
/usr/sbin/iptables -A checkcount -j RETURN
/usr/sbin/iptables -A INPUT -p icmp --icmp-type 8 -s 192.168.0.0/24 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
/usr/sbin/iptables -I INPUT -i eth0 -p tcp -m tcp -s 24.96.253.242 --dport 22 -j ACCEPT
/usr/sbin/iptables -I INPUT -i eth0 -p tcp -m tcp -s 184.57.118.205 --dport 22 -j ACCEPT
/usr/sbin/iptables -A INPUT -i eth0 -p tcp -m multiport --dports 1901:1914
/usr/sbin/iptables -A INPUT -p tcp --syn --dport 22 -i eth0 -j checkcount
/usr/sbin/iptables -A INPUT -p tcp --syn -m limit --limit 1/s --limit-burst 3 -i eth0 --dport 22 -j ACCEPT
/usr/sbin/iptables -A INPUT -i eth0 -p tcp --syn -m multiport --dports 25,80,143,443,587,993 -j ACCEPT
My iptables list (w/o DROPs):
Code:
> iptables -L -v -n --line-numbers | grep -v "DROP.*all"
Chain INPUT (policy DROP 5 packets, 308 bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1     9262  683K ACCEPT     tcp  --  eth0   *       184.57.118.205       0.0.0.0/0            tcp dpt:22
2        0     0 ACCEPT     tcp  --  eth0   *       24.96.253.242        0.0.0.0/0            tcp dpt:22
3    88391   17M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
4     4125  263K ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
5     3603  186K ACCEPT     tcp  --  eth1   *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x17/0x02
6    12828  975K ACCEPT     udp  --  eth1   *       0.0.0.0/0            0.0.0.0/0           
7       20  2166 ACCEPT     icmp --  *      *       192.168.0.0/24       0.0.0.0/0            icmptype 8 state NEW,RELATED,ESTABLISHED
>>> DROPs go here <<<<
172      4   204 checkcount  tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22 flags:0x17/0x02
173      4   204 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22 flags:0x17/0x02 limit: avg 1/sec burst 3
174    417 26040 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x17/0x02 multiport dports 25,80,143,443,587,993

Chain FORWARD (policy ACCEPT 1285 packets, 322K bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1    40230 9565K ACCEPT     all  --  eth1   *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 1931 packets, 449K bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain checkcount (1 references)
num   pkts bytes target     prot opt in     out     source               destination         
1        4   204            all  --  *      *       0.0.0.0/0            0.0.0.0/0            recent: SET name: DEFAULT side: source mask: 255.255.255.255
2        0     0 logdrop    all  --  *      *       0.0.0.0/0            0.0.0.0/0            recent: CHECK hit_count: 12 name: DEFAULT side: source mask: 255.255.255.255
3        4   204 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain logdrop (1 references)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            LOG flags 0 level 6 prefix "SSH Break-in attempt "
nat table:
Code:
# iptables -t nat -L -v -n --line-numbers 
Chain PREROUTING (policy ACCEPT 4039 packets, 304K bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1        0     0 REDIRECT   tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:587 redir ports 25
7     1058 55024 DNAT       tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:1906 to:192.168.0.52:xxxx
(more like above) 

Chain INPUT (policy ACCEPT 3699 packets, 261K bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 2233 packets, 150K bytes)
num   pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 2032 packets, 121K bytes)
num   pkts bytes target     prot opt in     out     source               destination         
1     1314 87668 MASQUERADE  all  --  *      eth0    0.0.0.0/0            0.0.0.0/0
So, what about this setup implicitly permits ports 1901-1914 in?

Last edited by mfoley; 09-20-2017 at 02:36 AM.
 
Old 09-20-2017, 12:10 AM   #18
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by rknichols View Post
What is that multiport line supposed to be doing? Since it has no target, the only effect of a packet matching it would be to increment that rule's byte and packet counts. In this particular case, all traffic (4 packets, 160 bytes), from 80.82.65.0/24 has already been dropped regardless of protocol or port (or perhaps ACCEPTed by one of the unseen rules 1-7), so traffic from that source could never reach that multiport rule.
Sorry, posted my last message before reading yours.

The intention is to open those ports for access. However, as I noted in my previous post, those ports appear to be open anyway, regardless of the multiport line.

As to the line itself, I guess I need a "-j ACCEPT" at the end. I've not noticed that before as obviously access has been a given.

My desire is to have ALL ports on eth0 closed which are not otherwise specifically open via iptables rules. Apparently, I'm failing at that.

I thought the "iptables -P INPUT DROP" rule would do that.

Quote:
or perhaps ACCEPTed by one of the unseen rules
They are getting through, so there must be some rule ACCEPTing.

Last edited by mfoley; 09-20-2017 at 12:50 AM.
 
Old 09-20-2017, 01:58 AM   #19
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
I haven't examined your iptables rules as others have but I noticed your use of two Ethernet interfaces and I have some "drive by" advice regarding iptables and multiple interfaces.

I've found that often when making rules with iptables that refer to multiple interfaces (eth0, eth1) the rules don't behave as expected due to ARP flux. Interface specific rules may depend upon whether a computer ARP response is host-based or interface-based.

ARP flux issues also involve how the Ethernet cables from different interfaces are connected to common or independent routers/switches etc.

That may not be the issue here but I mention it in case you might be depending upon the limitation of a rule to a specific interface which may not be acting as expected. You may want to review the thread linked above.
 
Old 09-20-2017, 02:29 AM   #20
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
TracyTiger, thanks, I'll investigate that ASAP.

Meanwhile, still under attack. I'm getting between 100 and 200 attempts every 5 minutes. They are trying some valid user IDs, but so far incorrect passwords.

I can't figure out how to shut off access to port 1906!! I've removed the corresponding multiport rule and the DROP rules for these IPs apparently have no effect.

Another interesting tidbit, I can telnet to 1906 from remote hosts, but I cannot do so from a host on the local LAN. I thought I permitted ALL ports on the local LAN (eth1).
Code:
# telnet 192.168.0.2 1906
Trying 192.168.0.2...
telnet: connect to address 192.168.0.2: Connection refused
 
Old 09-20-2017, 09:44 AM   #21
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,748

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
Quote:
Originally Posted by mfoley View Post
Code:
/usr/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1906 -j DNAT --to-destination 192.168.0.52:xxxx
Is 192.168.0.52 the LAN address for this same machine? If not, then that DNAT rule is going to cause those packets to go through the FORWARD chain, and they won't be seen in the INPUT chain at all. The INPUT chain is strictly for packets going to processes on the local host.

If you have firewall rules that you want applied in both the INPUT and FORWARD chains, you should create a user-defined chain (I call mine "Incoming") and jump to it from both the INPUT and FORWARD chains.
 
2 members found this post helpful.
Old 09-20-2017, 03:15 PM   #22
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by rknichols View Post
Is 192.168.0.52 the LAN address for this same machine?
No, it's not.
Quote:
If not, then that DNAT rule is going to cause those packets to go through the FORWARD chain, and they won't be seen in the INPUT chain at all. The INPUT chain is strictly for packets going to processes on the local host.
I was suspecting something like that.
Quote:
If you have firewall rules that you want applied in both the INPUT and FORWARD chains, you should create a user-defined chain (I call mine "Incoming") and jump to it from both the INPUT and FORWARD chains.
Despite my possibly elaborate rules, for which I've mostly depended on the kindness of strangers, I'm no expert on iptables. Could you give me an example of how to "create a user-defined chain ... and jump to it from both the INPUT and FORWARD chains"?
 
Old 09-20-2017, 03:49 PM   #23
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
https://www.linuxquestions.org/quest...tables-504520/
 
1 members found this post helpful.
Old 09-20-2017, 03:51 PM   #24
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
And more generally this one: http://www.netfilter.org/documentati...g-HOWTO-7.html

Funny, those are the two top google results for the search "iptables user defined chain"...

 
Old 09-20-2017, 04:14 PM   #25
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,826

Rep: Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610
It may be that a validator would help. Some builders have that feature. http://www.fwbuilder.org/4.0/features.shtml

If you don't have enough on your plate already.

Last edited by jefro; 09-20-2017 at 04:15 PM.
 
Old 09-20-2017, 04:44 PM   #26
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
So, if I do:
Code:
iptables -N rdc_forward
iptables -A rdc_forward -s 195.22.126.0/16 -j DROP

iptables -A INPUT -i eth0 -j rdc_forward
and remove my "iptables -t filter -I INPUT 8 -s 195.22.126.0/16 -j DROP" rule from the INPUT chain, that should work?

What about also "jumping" to the new chain from the FORWARD chain, as rknichols mentioned? Do I also need:
Code:
iptables -A FORWARD -i eth0 -j rdc_forward
In fact, why do I need to "jump to" the INPUT chain at all if the IPs I want to block are FORWARDs? As rknichols wrote, "they won't be seen in the INPUT chain at all. The INPUT chain is strictly for packets going to processes on the local host."

Last edited by mfoley; 09-20-2017 at 04:50 PM.
 
Old 09-20-2017, 05:35 PM   #27
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,748

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
Quote:
Originally Posted by mfoley View Post
So, if I do:
Code:
iptables -N rdc_forward
iptables -A rdc_forward -s 195.22.126.0/16 -j DROP

iptables -A INPUT -i eth0 -j rdc_forward
and remove my "iptables -t filter -I INPUT 8 -s 195.22.126.0/16 -j DROP" rule from the INPUT chain, that should work?

What about also "jumping" to the new chain from the FORWARD chain, as rknichols mentioned? Do I also need:
Code:
iptables -A FORWARD -i eth0 -j rdc_forward
In fact, why do I need to "jump to" the INPUT chain at all if the IPs I want to block are FORWARDs? As rknichols wrote, "they won't be seen in the INPUT chain at all. The INPUT chain is strictly for packets going to processes on the local host."
You should move all of your "DROPs go here" rules to the rdc_forward chain and jump to that chain from the FORWARD chain. If you don't need that filtering for packets destined for the local machine, then you don't need to jump to rdc_forward from the INPUT chain, but I would. Since those DROPs are for known bad actors, why let them probe for other ports on the local machine?

Another advantage of putting those DROPs in a separate chain is that it's a heck of a lot easier to dynamically add new DROPs to rdc_forward than it is to figure out where they need to be inserted in the INPUT or FORWARD chains.

You should really have Oskar Andreasson's Iptables Tutorial. It's getting a bit dated, but it's still a good tutorial on iptables as well as packet handling in general. I keep a PDF version stored locally, and refer to it frequently.

Last edited by rknichols; 09-20-2017 at 05:42 PM.
 
1 members found this post helpful.
Old 09-21-2017, 08:25 AM   #28
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Sorry to insist but you really should try to understand the /XX notation... 195.22.126.0/16 is equivalent to 195.22.0.0/16 ...
/XX is the size of the bitmask TO THE LEFT. 16 bits = 2 bytes = 2 numbers of the IP address.

One doc (it's just the first one that came in my quick search): https://www.digitalocean.com/communi...for-networking
 
Old 09-21-2017, 11:18 AM   #29
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,414

Original Poster
Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by NoStressHQ View Post
Sorry to insist but you really should try to understand the /XX notation... 195.22.126.0/16 is equivalent to 195.22.0.0/16 ...
/XX is the size of the bitmask TO THE LEFT. 16 bits = 2 bytes = 2 numbers of the IP address.
Yes, I know this. The automatic script searches for the CIDR, country, etc. based on xx.yy.zz.0/24 and uses that, together with the found CIDR to create the DROP. If there is no CIDR found it defaults to /16. That's as smart as the script gets.
Quote:
Originally Posted by rknichols View Post
You should move all of your "DROPs go here" rules to the rdc_forward chain and jump to that chain from the FORWARD chain. If you don't need that filtering for packets destined for the local machine, then you don't need to jump to rdc_forward from the INPUT chain, but I would. Since those DROPs are for known bad actors, why let them probe for other ports on the local machine?

Another advantage of putting those DROPs in a separate chain is that it's a heck of a lot easier to dynamically add new DROPs to rdc_forward than it is to figure out where they need to be inserted in the INPUT or FORWARD chains.
You are definitely right about the pain figuring out where DROP rules need to be inserted. Every time I have to add a "boiler-plate" rule I have to adjust my script accordingly. I've never really dealt much with user defined chains before this thread; except for the logdrop chain, which I understand, but didn't set up on my own. I guess now's as good a time as any. So -- changing the chain name to bad_people, would the following be correct:
Code:
iptables -P INPUT DROP
iptables -N bad_people
iptables -A bad_people -s 195.22.0.0/16 -j DROP
# >> DROPs go here <<

iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 587 -j REDIRECT --to-port 25

# FORWARDS TO OTHER HOSTS
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 1906 -j DNAT --to-destination 192.168.0.52:xxxx
# more like above

iptables -A INPUT -i eth0 -j bad_people
iptables -A FORWARD -i eth0 -j bad_people

# THEN THE REST OF MY RULES

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --syn -j ACCEPT
iptables -A INPUT -i eth1 -p udp -j ACCEPT
    
iptables -N logdrop
iptables -A logdrop -j LOG --log-level 6 --log-prefix "SSH Break-in attempt "
iptables -A logdrop -j DROP
    
iptables -N checkcount
iptables -A checkcount -m recent --set
iptables -A checkcount -m recent --rcheck --hitcount 12 -j logdrop
iptables -A checkcount -j RETURN
    
iptables -A INPUT -p icmp --icmp-type 8 -s 192.168.0.0/24 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -I INPUT -i eth0 -p tcp -m tcp -s $bu6500 --dport 22 -j ACCEPT
iptables -I INPUT -i eth0 -p tcp -m tcp -s $hostmon --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --syn --dport 22 -i eth0 -j checkcount   
iptables -A INPUT -p tcp --syn -m limit --limit 1/s --limit-burst 3 -i eth0 --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --syn -m multiport --dports 25,80,143,443,587,993 -j ACCEPT
Then, my DROP script should add rules as follows:
Code:
iptables -t filter -I bad_people 8 -s 193.253.0.0/16 -j DROP
Right? Do I even need the "-t filter" bit any more?

Please give me some feedback critique on these rules and their order as I hesitate implement this without a thumbs up from someone more expert.
Quote:
You should really have Oskar Andreasson's Iptables Tutorial. It's getting a bit dated, but it's still a good tutorial on iptables as well as packet handling in general. I keep a PDF version stored locally, and refer to it frequently.
Yes, I will definitely read that and check out NoStressHQ's link as well as I've never really stumbled across a good reference yet that didn't require me to already have a significant level of expertise.

Last edited by mfoley; 09-21-2017 at 11:20 AM.
 
Old 09-21-2017, 04:27 PM   #30
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,748

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
Quote:
Originally Posted by mfoley View Post
Then, my DROP script should add rules as follows:
Code:
iptables -t filter -I bad_people 8 -s 193.253.0.0/16 -j DROP
Right? Do I even need the "-t filter" bit any more?
I typically just append new rules to the bottom. That's even easier. There's a small performance advantage to adding someone who is pounding on you right now at the top of the list, but any connection that does not get filtered is going to be tested by all the rules anyway,

You never did need "-t filter" since that's the default.

Quote:
Please give me some feedback critique on these rules and their order as I hesitate implement this without a thumbs up from someone more expert.
Nothing bad jumps out at me on a cursory examination.
Quote:
Quote:
Originally Posted by rknichols View Post
You should really have Oskar Andreasson's Iptables Tutorial.
Yes, I will definitely read that
Actually, you won't. The PDF is 459 pages. You'll read certain sections and consult the rest as needed.
 
1 members found this post helpful.
  


Reply

Tags
attack, iptables


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
Routing from remote ip, to remote ip on linux by iptables dramcio Linux - Networking 1 10-26-2013 06:55 PM
LXer: Government accused of sneaking in web filter LXer Syndicated Linux News 0 05-22-2013 03:20 AM
Accessing remote desktop on VM from a remote machine using iptables cram869 Linux - Networking 3 03-07-2012 04:25 PM
LXer: Scalix is sneaking Linux in through the corporate mailbox LXer Syndicated Linux News 0 09-25-2006 11:33 PM
Sneaking an application under X11 kav Linux - Software 4 05-20-2006 12:04 PM

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

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