View previous topic :: View next topic |
Author |
Message |
billman Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 21 Oct 2005 Posts: 98
|
Posted: Mon Jan 23, 2006 6:24 am Post subject: Command lock network - SOLVED |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
nephros Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/145383245043ee5edfbdaa3.png)
Joined: 07 Feb 2003 Posts: 2139 Location: Graz, Austria (Europe - no kangaroos.)
|
Posted: Mon Jan 23, 2006 6:37 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
billman Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 21 Oct 2005 Posts: 98
|
Posted: Mon Jan 23, 2006 2:13 pm Post subject: |
|
|
Great - Thanks
Thats what I've been looking for.
Again, THANKS
Bill |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|