LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-24-2003, 09:20 AM   #1
Citizen Bleys
Member
 
Registered: Mar 2001
Location: Moncton, NB
Distribution: Gentoo 2006.0
Posts: 181

Rep: Reputation: 30
Ethernet and the /dev filesystem


1. Does anybody know if eth0 has an alias in the /dev filesystem?
2. How would I go about setting up a script that would automatically redirect input/output from a given device until I tell it to stop re-directing?

I'm in a class with a few mischief-makers at the moment; Everybody is using Red Hat Linux 7.3, except me--I brought in my own Red Hat 8.0 CDs. The point is, the environment is fairly heterogenous. I'm expecting, any day now, somebody to attempt to access my machine. (We're supposed to make our root passwords "password"; I haven't)

What I'd like to do is set up a shell script, which must be executed as root, which simply takes any packets coming in from the network and throws them directly to /dev/null. Any time I'm not actively using network resources, I can just run this script. Then, when I need access to the network again, I just hit ctrl+c.

As an added bonus, it'd be nice if I could make eth0 respond to any requests with a stream of garbage from /dev/urandom, but I don't just want to redirect /dev/urandom to eth0, as that would probably slow up the *entire* network.

of course, I could always unplug my network card when I'm not using it, too

EDIT: Actually, if I ran "cat /dev/null > /dev/*whatever eth0 is*" in an endless loop, would that not do absolutely nothing until someone talked to my NIC, and then return an EOF character to the requesting machine? That would be good. My final script could be three lines long, including the call to #!/bin/bash.

Last edited by Citizen Bleys; 11-24-2003 at 09:48 AM.
 
Old 11-24-2003, 09:51 AM   #2
sidey
Member
 
Registered: Mar 2003
Location: Essex UK
Distribution: rh 8.0 bsd 5.0 slack 9.0 rc2 crux
Posts: 147

Rep: Reputation: 15
or you could just do

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

to stop all packets
then

iptables -F
iptables -X

to enable them again
 
Old 11-24-2003, 11:50 AM   #3
Edward78
Member
 
Registered: Jul 2002
Distribution: OpenSuSE 11
Posts: 441

Rep: Reputation: 30
Quote:
(We're supposed to make our root passwords "password"; I haven't)
That is stupid, why can't they pick there own root pass.?
 
Old 11-24-2003, 12:05 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
there is no /dev/ entry for eth0... why not just stop the network???

/etc/init.d/network stop
 
Old 11-25-2003, 06:25 AM   #5
Citizen Bleys
Member
 
Registered: Mar 2001
Location: Moncton, NB
Distribution: Gentoo 2006.0
Posts: 181

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by acid_kewpie
/etc/init.d/network stop
why the hell didn't I think of that?
 
  


Reply


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
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 03:58 PM
How can I attach a compressed file to /dev/loop0 (for filesystem image recovery)? rjlee Linux - General 0 09-26-2004 04:11 PM
unable to change tty /dev/tty1 Read-only filesystem behmjose Linux From Scratch 1 01-02-2004 08:55 PM
my linux error : Couldn't open /dev/null (read-only filesystem) Darick Ang Linux - General 3 10-28-2003 01:27 PM
/dev filesystem problems anadyr Slackware 7 10-12-2003 11:33 AM

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

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