LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-09-2020, 12:48 PM   #16
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,442

Original Poster
Rep: Reputation: 110Reputation: 110

Quote:
Originally Posted by Turbocapitalist View Post
For archival and access purposes can you please post it here within [code] [/code] tags? Thanks in advance.
Isn't pastebin a better home for such a long piece of code?
 
Old 09-09-2020, 12:51 PM   #17
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,378
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
Not if you want people to read it. There is also a lot to be said for keeping all the discussion and the code in the same place. Pastebin links expire quickly, so the link will be dead sooner or later, and there's no telling how long that site as whole will be around. LQ posts will be around as long as LQ is around and that's what matters in this context.
 
1 members found this post helpful.
Old 09-09-2020, 07:07 PM   #18
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by lucmove View Post
Code:
# curl -i waterfox.net
HTTP/1.1 308 Permanent Redirect
Connection: close
Location: https://waterfox.net/
Server: Caddy
Date: Wed, 09 Sep 2020 15:17:15 GMT
Content-Length: 0

Code:
# curl -i 51.159.31.11
no output; it hangs
So you can block the site's IP address, as evidenced by the second curl command. When you use the site's DNS name, traffic is not blocked. Which tells me that the first curl command above resolves waterfox.net to a different IP address.

The only different IP address that I can find is 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0. So, try again after adding this rule to the OUTPUT chain:
Code:
iptables6 -I OUTPUT -d 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0/128 -j DROP
(I can't test this because I don't have IPv6 enabled right now)

Last edited by berndbausch; 09-09-2020 at 07:09 PM.
 
1 members found this post helpful.
Old 09-09-2020, 08:42 PM   #19
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,442

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Turbocapitalist View Post
For archival and access purposes can you please post it here within [code] [/code] tags? Thanks in advance.
I tried.

Quote:
The following errors occurred with your submission:
The text that you have entered is too long (76480 characters). Please shorten it to 30000 characters long.
 
Old 09-09-2020, 08:43 PM   #20
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,442

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by berndbausch View Post
The only different IP address that I can find is 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0. So, try again after adding this rule to the OUTPUT chain:
Code:
iptables6 -I OUTPUT -d 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0/128 -j DROP
I don't have iptables6 and it doesn't seem to be available in the Debian repository.
 
Old 09-09-2020, 08:54 PM   #21
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Side note.

http://fwbuilder.sourceforge.net/ might ease your building rules.

Thoughts.
Browser cache clear.
Ideally router would block.
Set hosts file for address to bad name and a 0.0.0.0 address. This may not work on some types of proxy.
 
1 members found this post helpful.
Old 09-10-2020, 12:51 AM   #22
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by lucmove View Post
I don't have iptables6 and it doesn't seem to be available in the Debian repository.
Then you need to figure out how to add rules for IPvv6 to your firewall.
 
Old 09-10-2020, 01:04 AM   #23
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,378
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
It's spelled differently. Try the spelling recommended in #9 above, or check the first page or so of the manual page for iptables.

Again, and I'll admit to nagging, after this is done please take a look at NFtables.

Last edited by Turbocapitalist; 09-10-2020 at 09:23 PM. Reason: spelling
 
Old 09-10-2020, 03:46 PM   #24
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,442

Original Poster
Rep: Reputation: 110Reputation: 110
This fixed the problem:

Code:
iptables6 -I OUTPUT -d 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0/128 -j DROP
I found that iptables6 in Debian is ip6tables. Grumble.

So:

Code:
ip6tables -I OUTPUT -d 2001:bc8:6005:1b:dac4:97ff:fe2a:2ec0/128 -j DROP
That really blocks the site I wanted to. Solved.

Note: I investigated NFtables and fwbuilder, and found both way too complicated for me. Maybe they seem 'simple' if you're used to iptables and know what you're doing. Neither is my case. I felt very helpeless at all the material that I read. I installed fwbuilder and found it very difficult to understand, never mind to use. That firewall script I shared on Pastebin has done the job for me for many years.

Thank you all. I appreciate the help.
 
Old 09-10-2020, 09:26 PM   #25
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,378
Blog Entries: 3

Rep: Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772Reputation: 3772
Great that it's working. One thing which will increase the speed would be to use REJECT as a target instead of DROP on the outgoing packets. Otherwise it is you who has to wait for the connection to time out.
 
1 members found this post helpful.
  


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
block particular web site form multiple site hosted web server and allow others lasantha Linux - Security 2 08-17-2010 01:49 PM
block particular web site form multiple site hosted web server and allow others lasantha Linux - Security 1 08-17-2010 12:09 PM
Apache site redirects using what rule? foo.site.com -> www.site.com/foo LaughingBoy Linux - Server 2 04-16-2009 09:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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