Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 11-24-2003, 09:20 AM   #1
Citizen Bleys
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
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

iptables -F
iptables -X

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

Rep: Reputation: 30
(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
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
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
Registered: Mar 2001
Location: Moncton, NB
Distribution: Gentoo 2006.0
Posts: 181

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


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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration