Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Command lock network - SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
billman
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2005
Posts: 98

PostPosted: Mon Jan 23, 2006 6:24 am    Post subject: Command lock network - SOLVED Reply with quote

Is there a command or bash to run in order to lock or disconnect traffic incomming and outgoing. and vice versa to reconnect without having to physically disconnect the cable.

Thanks,
Bill


Last edited by billman on Mon Jan 23, 2006 2:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Mon Jan 23, 2006 6:37 am    Post subject: Reply with quote

Depends on what level you want to cut traffic.

You could build the driver of your NIC modular, and remove the kernel module. (After stopping all networking daemeons on that interface)

You could do a "ifconfig ethX down" to bring down the interface as root or use "/etc/init.d/net.ethX stop" which does the same but stops all network services depending on it too.

Or you could do it with iptables using for example:
Code:
for c in $(cat /proc/net/ip_tables_names 2>/dev/null); do
  iptables -t $c -F
  iptables -t $c -X
done
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

But you'd have to work out a way to get your firewall to accept connections again, probably via "etc/init.d/iptables save" and "restore"

Finally there is a program called "tcpkill" which lets you cut off established TCP connections.
This will end one connction, but whoever initiated it is free to restart it any time. tcpkill is part of the net-analyzer/dsniff package.

These are just suggestions, not really a solution.
Hope this help a bit, if you want more info explain a bit more what you want to use it for.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
billman
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2005
Posts: 98

PostPosted: Mon Jan 23, 2006 2:13 pm    Post subject: Reply with quote

Great - Thanks

Thats what I've been looking for.

Again, THANKS
Bill
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum