Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-26-2015, 06:18 PM   #1
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Rep: Reputation: Disabled
--reject-with icmp-port-unreachable question

I am currently blocking port 80:
iptables -A INPUT -p tcp --destination-port 80 -j DROP

What I was wondering, if I use the REJECT below, is a message displayed in the browser of the REJECTed? Is there any way to send back a personally scripted message?

iptables -A INPUT -p TCP --dport 80 -j REJECT --reject-with icmp-port-unreachable tcp-reset

Old 01-27-2015, 04:03 AM   #2
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
If you want to create the message you've got to send TCP data to their browser giving the HTTP code 403 or whatever.

Packet level actions won't do that but will leave their browser showing its own version of "connection failed" or just a blank screen or whatever the browser programmer decided on.


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
PF_PACKET socket and 'Port unreachable' ICMP messages DavidA Programming 5 10-23-2012 12:55 PM
[SOLVED] Snort Signature: ICMP Destination Unreachable Port Unreachable very noisy mhollis Linux - Security 4 08-15-2011 02:01 PM
IPTABLES question - how do you reject icmp? Thaidog Linux - Networking 12 12-06-2007 11:16 AM
ICMP Port unreachable Ciralia Linux - Software 1 06-14-2007 10:20 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration