/l3/users/29-05-2007/nt-lnet/linux1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 :31 :32 :33 :34 :35 :36 :37 :38 :39 :40 |
|
#iptables -L -v
Chain INPUT (policy ACCEPT 14747 packets, 1046K bytes) pkts bytes target prot opt in out source destination 88 6734 REJECT 0 -- any any !net.nt anywhere reject-with icmp-port-unreachable 0 0 REJECT icmp -- any any anywhere anywhere reject-with icmp-port-unreachable Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 14059 packets, 3226K bytes) pkts bytes target prot opt in out source destination |
#pkill -9 screen
|
#ping
Usage: ping [-LRUbdfnqrvVaA] [-c count] [-i interval] [-w deadline] [-p pattern] [-s packetsize] [-t ttl] [-I interface or address] [-M mtu discovery hint] [-S sndbuf] [ -T timestamp option ] [ -Q tos ] [hop1 ...] destination |
#watch 'iptables -L -vv'
the error packet returned: --reject-with type The type given can be icmp-net-unreachable icmp-host-unreachable icmp-port-unreachable icmp-proto-unreachable icmp-net-prohibited icmp-host-prohibited or icmp-admin-prohibited (*) which return the appropriate ICMP error message (port-unreachable is the --iif ifname Change the packet’s incoming interface to ‘ifname’ --gw IP_address Route the packet via this gateway --continue Behave like a non-terminating target and continue traversing the rules. Not valid in combination with ‘--iif’ or ‘--tee’ The options that are recognized by iptables can be divided into several different groups. Manual page iptables(8) line 1217/1494 84% |
#iptables -A INPUT -p 1 -s! 192.168.16.15 -j DROP
[root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# iptables -A INPUT -p 1 -s! 192.168.16.15 -j DROP [root@linux1:~]# [root@linux1:~]# ping [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# iptables -F INPUT [root@linux1:~]# iptables -A INPUT -p 1 -s! 192.168.16.15 -------------------------------------------------------------------------------------------------- |
#ping 192.168.16.1
[root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# iptables -A INPUT -p 1 -s! 192.168.16.15 -j DROP [root@linux1:~]# [root@linux1:~]# ping 192.168.16.1 [root@linux1:~]# ... [root@linux1:~]# --- 192.168.16.1 ping statistics --- [root@linux1:~]# iptables -F INPUT 4 packets transmitted, 0 received, 100% packet loss, time 3017ms [root@linux1:~]# iptables -A INPUT -p 1 -s! 192.168.16.15 [root@linux1:~]# iptables -v PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. --- 192.168.16.1 ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3017ms -------------------------------------------------------------------------------------------------- |
#iptables -v -L
[root@linux1:~]# iptables -v -L Chain INPUT (policy ACCEPT 15601 packets, 1106K bytes) pkts bytes target prot opt in out source destination 4 336 DROP icmp -- any any !net.nt anywhere Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination -------------------------------------------------------------------------------------------------- Chain OUTPUT (policy ACCEPT 14787 packets, 3500K bytes) pkts bytes target prot opt in out source destination [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# Chain INPUT (policy ACCEPT 15601 packets, 1106K bytes) pkts bytes target prot opt in out source destination 4 336 DROP icmp -- any any !net.nt anywhere Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 14787 packets, 3500K bytes) pkts bytes target prot opt in out source destination |
#lynx ya.ru
|
#ifconfig
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3632 errors:0 dropped:0 overruns:0 frame:0 TX packets:3632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1103455 (1.0 MiB) TX bytes:1103455 (1.0 MiB) |
##iptables -A INPUT -o eth3 -p tcp -d
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3632 errors:0 dropped:0 overruns:0 frame:0 TX packets:3632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1103455 (1.0 MiB) TX bytes:1103455 (1.0 MiB) [root@linux1:~]# #iptables -A INPUT -o eth3 -p tcp -d [root@linux1:~]# p |
#ping ya.ru
PING mail.ru (194.67.57.26) 56(84) bytes of data. --- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING ya.ru (87.250.251.8) 56(84) bytes of data. --- ya.ru ping statistics --- 5 packets transmitted, 0 received, 100% packet loss, time 4000ms |
#ping mail.ru
PING mail.ru (194.67.57.26) 56(84) bytes of data. --- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#iptables -F INPUT
|
#ping mail.ru
64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 119.964/119.964/119.964/0.000 ms [root@linux1:~]# iptables -A INPUT -o eth3 -p tcp -d 213.180. PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms |
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 119.964/119.964/119.964/0.000 ms |
#iptables -A INPUT -o eth3 -p tcp -d 213.180.204.8 -j REJECT -
[root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- iptables v1.3.6: Unknown arg `-j' Try `iptables -h' or 'iptables --help' for more information. |
#man iptables
|
#iptables -A INPUT -o eth3 -p tcp -d 213.180.204.8 -j REJECT --reset-whith tcp-re
[root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- et iptables v1.3.6: Unknown arg `--reset-whith' Try `iptables -h' or 'iptables --help' for more information. |
#man iptables
|
#man iptables
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -A INPUT -p 1 -j REJECT --reject-whith icmp-admin-prohibited
1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- iptables v1.3.6: Unknown arg `--reject-whith' Try `iptables -h' or 'iptables --help' for more information. |
#man iptables
|
#iptables -A INPUT -p 1 -j REJECT --reject-with icmp-admin-prohibited
|
#iptables -A INPUT -p 1 -j REJECT --reject-whith icmp-admin-prohibited
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#ping 192.168.16.1
[root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. --- 192.168.16.1 ping statistics --- 7 packets transmitted, 0 received, 100% packet loss, time 6000ms |
#iptables -L -v
Chain INPUT (policy ACCEPT 21962 packets, 1488K bytes) pkts bytes target prot opt in out source destination 14 1372 REJECT icmp -- any any anywhere anywhere reject-with icmp-admin-prohibited Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 20891 packets, 5054K bytes) pkts bytes target prot opt in out source destination |
#iptables -D INPUT -p 1 -j REJECT --reject-with icmp-admin-prohibited
|
#man iptables
|
#iptables -A INPUT -p 1 -j REJECT --reject-with icmp-net-prohibited
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#iptables -L -v
Chain INPUT (policy ACCEPT 23059 packets, 1555K bytes) pkts bytes target prot opt in out source destination 0 0 REJECT icmp -- any any anywhere anywhere reject-with icmp-net-prohibited Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 21994 packets, 5344K bytes) pkts bytes target prot opt in out source destination |
#ping 192.168.16.1
[root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. --- 192.168.16.1 ping statistics --- 23 packets transmitted, 0 received, 100% packet loss, time 22000ms |
#man iptables
|
#ping ya.ru
|
#iptables -F INPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#man iptables
|
#iptables -F INPUT
|
#iptables -A INPUT -p 1 -j REJECT --reject-with icmp-net-unreachable
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. --- 192.168.16.1 ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 2999ms |
#ssh 192.168.16.2
rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- root@192.168.16.2's password: Last login: Wed May 30 15:26:38 2007 Linux linux2 2.6.21.2 #1 SMP Thu May 24 13:33:22 EEST 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=2803; pidfile=/root/.lilalo/l3-agent.pid |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. From 192.168.16.1 icmp_seq=1 Destination Net Unreachable From 192.168.16.1 icmp_seq=2 Destination Net Unreachable From 192.168.16.1 icmp_seq=3 Destination Net Unreachable From 192.168.16.1 icmp_seq=4 Destination Net Unreachable From 192.168.16.1 icmp_seq=5 Destination Net Unreachable From 192.168.16.1 icmp_seq=6 Destination Net Unreachable From 192.168.16.1 icmp_seq=7 Destination Net Unreachable --- 192.168.16.1 ping statistics --- 7 packets transmitted, 0 received, +7 errors, 100% packet loss, time 6001ms |
#exit
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- Connection to 192.168.16.2 closed. |
#iptables -F INPUT
|
#man iptables
|
#iptables -A INPUT -p 1 -j REJECT --reject-with icmp-admin-prohibited
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#ssh 192.168.16.2
root@192.168.16.2's password: Last login: Wed May 30 15:54:19 2007 from linux1.net.nt Linux linux2 2.6.21.2 #1 SMP Thu May 24 13:33:22 EEST 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=2803; pidfile=/root/.lilalo/l3-agent.pid |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. From 192.168.16.1 icmp_seq=1 Packet filtered From 192.168.16.1 icmp_seq=2 Packet filtered From 192.168.16.1 icmp_seq=3 Packet filtered From 192.168.16.1 icmp_seq=4 Packet filtered From 192.168.16.1 icmp_seq=5 Packet filtered From 192.168.16.1 icmp_seq=6 Packet filtered From 192.168.16.1 icmp_seq=7 Packet filtered From 192.168.16.1 icmp_seq=8 Packet filtered From 192.168.16.1 icmp_seq=9 Packet filtered From 192.168.16.1 icmp_seq=10 Packet filtered From 192.168.16.1 icmp_seq=11 Packet filtered From 192.168.16.1 icmp_seq=12 Packet filtered --- 192.168.16.1 ping statistics --- 12 packets transmitted, 0 received, +12 errors, 100% packet loss, time 10997ms |
#exit
Connection to 192.168.16.2 closed. |
#iptables -A INPUT -p 1 -j REJECT --reject-with ic
|
#iptables -F INPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#w3m ya.ru
|
##iptables -A OUTPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#ping ya.ru
64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=135 ms 64 bytes from ya.ru (213.180.204.8): icmp_seq=2 ttl=53 time=109 ms --- ya.ru ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 109.627/122.568/135.510/12.946 ms |
#iptables -A OUTPUT -p tcp -d 213.180.204.8 -j REJECT --reset-with tcp-reset
1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- iptables v1.3.6: Unknown arg `--reset-with' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A OUTPUT -p tcp -d 213.180.204.8 -j REJECT --reject-with tcp-reset
|
#ping ya.ru
PING ya.ru (87.250.251.8) 56(84) bytes of data. 64 bytes from ya.ru (87.250.251.8): icmp_seq=1 ttl=53 time=113 ms 64 bytes from ya.ru (87.250.251.8): icmp_seq=2 ttl=53 time=111 ms --- ya.ru ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 111.996/112.845/113.694/0.849 ms |
#w3m ya.ru
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#lynx ya.ru
|
#iptables -A OUTPUT -p tcp -o eth3
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#iptables -A OUTPUT -p tcp -d 213.180.204.8 -j REJECT --reset-with tcp-reset
|
#lynx ya.ru
|
#ping ya.ru
PING ya.ru (87.250.251.8) 56(84) bytes of data. 64 bytes from ya.ru (87.250.251.8): icmp_seq=1 ttl=53 time=111 ms --- ya.ru ping statistics --- 2 packets transmitted, 1 received, 50% packet loss, time 1000ms rtt min/avg/max/mdev = 111.763/111.763/111.763/0.000 ms |
#lynx ya.ru
|
#lynx ya.ru
|
#ping ya.ru
|
#lynx ya.ru
|
#w3m ya.ru
|
#iptables -A OUTPUT -p tcp -s 192.168.16.1
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#lynx ya.ru
|
#iptables -A OUTPUT -p tcp -s 192.168.16.1 -o eth3 -d 213.180.204.8 -j REJECT --r
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- ject-with tcp-reset |
#w3m ya.ru
|
#ping ya.ru
PING ya.ru (87.250.251.8) 56(84) bytes of data. 64 bytes from ya.ru (87.250.251.8): icmp_seq=1 ttl=53 time=122 ms --- ya.ru ping statistics --- 2 packets transmitted, 1 received, 50% packet loss, time 1002ms rtt min/avg/max/mdev = 122.703/122.703/122.703/0.000 ms |
#w3m ya.ru
|
#w3m ya.ru
|
#iptables -F INPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#ssh clint@net.nt
rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- clint@net.nt's password: clint~$ sudo iptables - Password: clint~$ sudo iptables -A INPUT -s 192.168.16.1 -o eth1 -p tcp -j REJECT --reject-with tcp-reset Password: iptables v1.3.6: Can't use -o with INPUT Try `iptables -h' or 'iptables --help' for more information. clint~$ sudo iptables -A INPUT -s 192.168.16.1 -i eth1 -p tcp -j REJECT --reject-with tcp-reset clint~$ Read from remote host net.nt: Connection reset by peer Connection to net.nt closed. |
#ping mail.ru
64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- PING mail.ru (194.67.57.26) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.26): icmp_seq=1 ttl=112 time=156 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=2 ttl=112 time=106 ms --- mail.ru ping statistics --- 3 packets transmitted, 2 received, 33% packet loss, time 2000ms rtt min/avg/max/mdev = 106.836/131.689/156.543/24.856 ms |
#lynx www.ya.ru
|
#iptables -F INPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- anywhere ya.ru reject-with tcp-reset REJECT tcp -- anywhere ya.ru reject-with tcp-reset REJECT tcp -- linux1.net.nt ya.ru reject-with tcp-reset |
#iptables -F OUTPUT
--- mail.ru ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms [root@linux1:~]# iptables -F INPUT [root@linux1:~]# ping mail.ru PING mail.ru (194.67.57.126) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.126): icmp_seq=1 ttl=112 time=114 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#nslookup ya.ru
--- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- Server: 192.168.16.15 Address: 192.168.16.15#53 Non-authoritative answer: Name: ya.ru Address: 213.180.204.8 Name: ya.ru Address: 87.250.251.8 |
#iptables -L -v
Chain INPUT (policy ACCEPT 31986 packets, 2151K bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 30603 packets, 7200K bytes) pkts bytes target prot opt in out source destination |
#iptables -A OUTPUT -d
|
#ping ya.ru
PING ya.ru (87.250.251.8) 56(84) bytes of data. 64 bytes from ya.ru (87.250.251.8): icmp_seq=1 ttl=53 time=115 ms --- ya.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 115.858/115.858/115.858/0.000 ms |
#iptables -L
1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 114.465/114.465/114.465/0.000 ms [root@linux1:~]# ping ya.ru PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=53 time=119 ms --- ya.ru ping statistics --- Chain INPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- anywhere ya.ru reject-with tcp-reset Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination REJECT tcp -- anywhere ya.ru reject-with tcp-reset |
#iptables -A INPUT -s 87.250.251.8 -j REJECT --reject-with tcp-reset
iptables: Invalid argument |
#iptables -A INPUT -d 87.250.251.8 -j REJECT --reject-with tcp-reset
iptables: Invalid argument |
#iptables -A INPUT -p tcp -d 87.250.251.8 -j REJECT --reject-with tcp-reset
|
#lynx ya.ru
|
Время первой команды журнала | 15:40:37 2007- 5-30 | |||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 16:09:09 2007- 5-30 | |||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 27.72 | |||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.48 | |||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 3.54 | |||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008