LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Ethernet and the /dev filesystem (https://www.linuxquestions.org/questions/linux-software-2/ethernet-and-the-dev-filesystem-119457/)

Citizen Bleys 11-24-2003 09:20 AM

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.

sidey 11-24-2003 09:51 AM

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

Edward78 11-24-2003 11:50 AM

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.?

acid_kewpie 11-24-2003 12:05 PM

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

/etc/init.d/network stop

Citizen Bleys 11-25-2003 06:25 AM

Quote:

Originally posted by acid_kewpie
/etc/init.d/network stop
why the hell didn't I think of that?


All times are GMT -5. The time now is 10:42 AM.