LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-21-2014, 10:04 PM   #1
zerop
Member
 
Registered: Jul 2014
Posts: 65

Rep: Reputation: Disabled
Question how to block all tcp and udp and other protocol and only allow layer 2 communication?


sudo ufw disable
sudo ufw default deny
sudo ufw allow XXXX
sudo ufw enable
Does sudo ufw disable block layer 2 by default?
How to block all TCP, UDP and other protocols, so only layer 2 communication is allowed?
How to drop a frame when layer 2 received frame size is greater than 64?
All these will be in dedicated line of ISP.

if using iptable, is below command correct?

iptables -N CHECK1
iptables -A INPUT -p all -m length --length 0
iptables -A CHECK1 -j DROP
or

// drop all
iptables -N CHECK1
iptables -A INPUT -p all
iptables -A CHECK1 -j DROP
update:

iptable -p option do not have layer 2 after googled how to drop frame over size 64?

should we consider size of tpacket_hdr as well? 32+64 = 96 because size of tpacket_hdr = 32
 
Old 07-23-2014, 08:49 PM   #2
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
What exactly are you trying to do? I'm not sure you quite understand networking. TCP/UDP are above layer 2 and encapsulated in layer 2. You can block it all but you're not blocking layer 2, just nothing will work because applications that communicate using Layer 3 and above won't be able to communicate.

Also to limit size of layer 2 packets you want to look at MTU.
 
  


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
tcp & udp communication utility in linux saman_artorious Linux - Networking 2 07-29-2013 11:24 PM
TCP & UDP Protocol forumbala88 Linux - Server 2 03-25-2013 05:08 AM
Communication TCP / UDP Ports Problem vivanguarda Slackware 2 11-24-2010 05:56 AM
Data communication between L4 (TCP) layer to application layer Mr.J Linux - Kernel 3 04-12-2009 02:50 PM
UDP & TCP Port Communication is Filtered/Open in nmap benderan Linux - Networking 8 01-21-2009 05:15 PM

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

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