Журнал лабораторных работ

Содержание

Журнал

Среда (06/09/10)

/dev/tty2
08:49:06
#pkill -1 xinetd

08:51:14
#who
user     tty1         2010-06-09 10:31
user     tty2         2010-06-09 12:21
root     tty3         2010-06-09 12:44
root     pts/1        2010-06-09 10:30 (linux254.unix.bas)
root     pts/3        2010-06-09 10:30 (linux8.unix.bas)
root     pts/5        2010-06-09 10:33 (linux1.unix.bas)
root     pts/7        2010-06-09 11:43 (:pts/2:S.0)
root     pts/10       2010-06-09 10:38 (linux2.unix.bas)
root     pts/12       2010-06-09 10:38 (linux7.unix.bas)
08:51:59
#jobs

08:52:07
#netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 localhost.localdomai:finger localhost.localdomain:41054 CLOSE_WAIT
tcp        0      0 linux4.unix.bas:finger      linux4.unix.bas:55938       CLOSE_WAIT
tcp        0      0 linux4.unix.bas:33860       linux2.unix.bas:finger      ESTABLISHED
tcp        0      0 localhost.localdomai:finger localhost.localdomain:49896 CLOSE_WAIT
tcp        0      0 linux4.unix.bas:ssh         linux8.unix.bas:51496       ESTABLISHED
tcp        0      0 linux4.unix.bas:ssh         linux7.unix.bas:40530       ESTABLISHED
tcp        0      0 linux4.unix.bas:ssh         linux254.unix.bas:52634     ESTABLISHED
tcp        0      0 linux4.unix.bas:ssh         linux1.unix.bas:49353       ESTABLISHED
...
unix  2      [ ]         DGRAM                    8553
unix  2      [ ]         DGRAM                    8543
unix  3      [ ]         STREAM     CONNECTED     8522
unix  3      [ ]         STREAM     CONNECTED     8521
unix  3      [ ]         STREAM     CONNECTED     8479
unix  3      [ ]         STREAM     CONNECTED     8478
unix  2      [ ]         DGRAM                    8373
unix  2      [ ]         DGRAM                    8118
unix  3      [ ]         STREAM     CONNECTED     8053
unix  3      [ ]         STREAM     CONNECTED     8052
08:52:24
#netstat | grep 79
unix  3      [ ]         STREAM     CONNECTED     8479
08:52:38
#kill 8479
bash: kill: (8479) - No such process
08:53:24
#kill -9 8479
bash: kill: (8479) - No such process
/dev/pts/7
08:53:43
#man sshd_config
/dev/pts/8
08:53:43
#man sshd_config
прошло 95 минут
/dev/pts/7
10:29:02
#cat /proc/sys/net/ipv4/
cipso_cache_bucket_size            tcp_dsack
cipso_cache_enable                 tcp_ecn
cipso_rbm_optfmt                   tcp_fack
cipso_rbm_strictvalid              tcp_fin_timeout
conf/                              tcp_frto
icmp_echo_ignore_all               tcp_keepalive_intvl
icmp_echo_ignore_broadcasts        tcp_keepalive_probes
icmp_errors_use_inbound_ifaddr     tcp_keepalive_time
icmp_ignore_bogus_error_responses  tcp_low_latency
icmp_ratelimit                     tcp_max_orphans
...
neigh/                             tcp_tso_win_divisor
netfilter/                         tcp_tw_recycle
route/                             tcp_tw_reuse
tcp_abc                            tcp_window_scaling
tcp_abort_on_overflow              tcp_wmem
tcp_adv_win_scale                  tcp_workaround_signed_windows
tcp_app_win                        udp_mem
tcp_base_mss                       udp_rmem_min
tcp_congestion_control             udp_wmem_min
tcp_dma_copybreak
/dev/pts/8
10:29:02
#cat /proc/sys/net/ipv4/
cipso_cache_bucket_size            tcp_dsack
cipso_cache_enable                 tcp_ecn
cipso_rbm_optfmt                   tcp_fack
cipso_rbm_strictvalid              tcp_fin_timeout
conf/                              tcp_frto
icmp_echo_ignore_all               tcp_keepalive_intvl
icmp_echo_ignore_broadcasts        tcp_keepalive_probes
icmp_errors_use_inbound_ifaddr     tcp_keepalive_time
icmp_ignore_bogus_error_responses  tcp_low_latency
icmp_ratelimit                     tcp_max_orphans
...
neigh/                             tcp_tso_win_divisor
netfilter/                         tcp_tw_recycle
route/                             tcp_tw_reuse
tcp_abc                            tcp_window_scaling
tcp_abort_on_overflow              tcp_wmem
tcp_adv_win_scale                  tcp_workaround_signed_windows
tcp_app_win                        udp_mem
tcp_base_mss                       udp_rmem_min
tcp_congestion_control             udp_wmem_min
tcp_dma_copybreak
10:29:02
#cat /proc/sys/net/ipv4/ip_forward
1
/dev/pts/7
10:29:02
#cat /proc/sys/net/ipv4/ip_forward
1
прошло 13 минут
/dev/pts/8
10:42:08
#cat /etc/sysctl.conf | grep -v ^#
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
/dev/pts/7
10:42:08
#cat /etc/sysctl.conf | grep -v ^#
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
10:43:05
#cat /etc/sysctl.conf | grep -v ^# | grep -xv ''
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
/dev/pts/8
10:43:05
#cat /etc/sysctl.conf | grep -v ^# | grep -xv ''
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
10:43:57
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
/dev/pts/7
10:43:57
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
прошло 20 минут
11:04:56
#iptables -P FORWARD -j DROP
iptables v1.3.5: -P requires a chain and a policy
Try `iptables -h' or 'iptables --help' for more information.
/dev/pts/8
11:04:56
#iptables -P FORWARD -j DROP
iptables v1.3.5: -P requires a chain and a policy
Try `iptables -h' or 'iptables --help' for more information.
/dev/pts/7
11:06:59
#iptables -P FORWARD DROP

/dev/pts/8
11:06:59
#iptables -P FORWARD DROP

/dev/pts/7
11:07:11
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 192K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/8
11:07:11
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 192K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/7
11:08:55
#iptables -I FORWARD -i eth0 -j DROP

/dev/pts/8
11:08:55
#iptables -I FORWARD -i eth0 -j DROP

/dev/pts/7
11:15:13
#ip
ip                 ipcalc             ipppd              iptables-restore
ip6tables          ipcrm              ipppstats          iptables-save
ip6tables-restore  ipcs               iprofd             iptstate
ip6tables-save     ipmaddr            iptables           iptunnel
/dev/pts/8
11:15:13
#ip
ip                 ipcalc             ipppd              iptables-restore
ip6tables          ipcrm              ipppstats          iptables-save
ip6tables-restore  ipcs               iprofd             iptstate
ip6tables-save     ipmaddr            iptables           iptunnel
11:15:13
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
/dev/pts/7
11:15:13
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
/dev/pts/8
11:15:23
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  eth0   any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/7
11:15:23
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  eth0   any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/8
11:15:32
#iptables -D FORWARD -i eth0 -j DROP

/dev/pts/7
11:15:32
#iptables -D FORWARD -i eth0 -j DROP

/dev/pts/8
11:16:57
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/7
11:16:57
#iptables -L -v
Chain INPUT (policy ACCEPT 271K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
11:16:59
#tail | iptables -L -v
Chain INPUT (policy ACCEPT 272K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
q
[1]+  Stopped                 tail | iptables -L -v
/dev/pts/8
11:16:59
#tail | iptables -L -v
Chain INPUT (policy ACCEPT 272K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
 pkts bytes target     prot opt in     out     source               destination
q
[1]+  Stopped                 tail | iptables -L -v
11:17:33
#kill %1
[1]+  Done                    tail | iptables -L -v
/dev/pts/7
11:17:33
#kill %1
[1]+  Done                    tail | iptables -L -v
/dev/pts/8
11:17:41
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 272K packets, 28M bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
2        0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
3        0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
4        0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
2        0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
3        0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
4        0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
5        0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
num   pkts bytes target     prot opt in     out     source               destination
/dev/pts/7
11:17:41
#iptables -L -v --line-numbers
Chain INPUT (policy ACCEPT 272K packets, 28M bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
2        0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
3        0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
4        0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
2        0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
3        0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
4        0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
5        0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 193K packets, 570M bytes)
num   pkts bytes target     prot opt in     out     source               destination
/dev/pts/8
11:22:46
#iptables -L -v --line-numbers | tail
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 DROP       all  --  eth1   any     192.168.0.0/16       anywhere
2        0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
3        0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
4        0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
5        0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
6        0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 194K packets, 570M bytes)
num   pkts bytes target     prot opt in     out     source               destination
/dev/pts/7
11:22:46
#iptables -L -v --line-numbers | tail
num   pkts bytes target     prot opt in     out     source               destination
1        0     0 DROP       all  --  eth1   any     192.168.0.0/16       anywhere
2        0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
3        0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
4        0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
5        0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
6        0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 194K packets, 570M bytes)
num   pkts bytes target     prot opt in     out     source               destination
11:22:56
#iptables -I FORWARD -i eth10 -s 192.168.0.0/16 -j DROP

/dev/pts/8
11:22:56
#iptables -I FORWARD -i eth10 -s 192.168.0.0/16 -j DROP

/dev/pts/7
11:24:09
#iptables -D FORWARD -i eth1 -s 192.168.0.0/16 -j DROP

/dev/pts/8
11:24:09
#iptables -D FORWARD -i eth1 -s 192.168.0.0/16 -j DROP

11:24:18
#iptales-save
bash: iptales-save: command not found
/dev/pts/7
11:24:18
#iptales-save
bash: iptales-save: command not found
/dev/pts/8
11:24:26
#iptables-save
# Generated by iptables-save v1.3.5 on Wed Jun  9 15:24:29 2010
*nat
:PREROUTING ACCEPT [168:22930]
:POSTROUTING ACCEPT [863:56891]
:OUTPUT ACCEPT [865:57051]
-A POSTROUTING -s 192.168.122.0/255.255.255.0 -d ! 192.168.122.0/255.255.255.0 -j MASQUERADE
COMMIT
# Completed on Wed Jun  9 15:24:29 2010
# Generated by iptables-save v1.3.5 on Wed Jun  9 15:24:29 2010
*filter
...
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A FORWARD -d 192.168.122.0/255.255.255.0 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/255.255.255.0 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
COMMIT
# Completed on Wed Jun  9 15:24:29 2010
/dev/pts/7
11:24:26
#iptables-save
# Generated by iptables-save v1.3.5 on Wed Jun  9 15:24:29 2010
*nat
:PREROUTING ACCEPT [168:22930]
:POSTROUTING ACCEPT [863:56891]
:OUTPUT ACCEPT [865:57051]
-A POSTROUTING -s 192.168.122.0/255.255.255.0 -d ! 192.168.122.0/255.255.255.0 -j MASQUERADE
COMMIT
# Completed on Wed Jun  9 15:24:29 2010
# Generated by iptables-save v1.3.5 on Wed Jun  9 15:24:29 2010
*filter
...
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A FORWARD -d 192.168.122.0/255.255.255.0 -o virbr0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/255.255.255.0 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
COMMIT
# Completed on Wed Jun  9 15:24:29 2010
11:24:29
#/etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
/dev/pts/8
11:24:29
#/etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
/dev/pts/16
11:30:10
#screen -x
/dev/pts/7
11:32:57
#iptables -L -v
Chain INPUT (policy ACCEPT 275K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
    0     0 DROP       icmp --  any    any     anywhere             anywhere
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 196K packets, 571M bytes)
 pkts bytes target     prot opt in     out     source               destination
/dev/pts/8
11:32:57
#iptables -L -v
Chain INPUT (policy ACCEPT 275K packets, 28M bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:domain
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:domain
    0     0 ACCEPT     udp  --  virbr0 any     anywhere             anywhere            udp dpt:bootps
    0     0 ACCEPT     tcp  --  virbr0 any     anywhere             anywhere            tcp dpt:bootps
    0     0 DROP       icmp --  any    any     anywhere             anywhere
Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    virbr0  anywhere             192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 any     192.168.122.0/24     anywhere
    0     0 ACCEPT     all  --  virbr0 virbr0  anywhere             anywhere
    0     0 REJECT     all  --  any    virbr0  anywhere             anywhere            reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 any     anywhere             anywhere            reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 196K packets, 571M bytes)
 pkts bytes target     prot opt in     out     source               destination
11:33:21
#iptables -L -v | less
/dev/pts/7
11:33:21
#iptables -L -v | less
11:33:44
#ping 192.168.15.4
PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
[1]+  Stopped                 ping 192.168.15.4
/dev/pts/8
11:33:44
#ping 192.168.15.4
PING 192.168.15.4 (192.168.15.4) 56(84) bytes of data.
[1]+  Stopped                 ping 192.168.15.4
11:34:05
#kill %1
[1]+  Terminated              ping 192.168.15.4
/dev/pts/7
11:34:05
#kill %1
[1]+  Terminated              ping 192.168.15.4
/dev/pts/8
11:34:26
#jobs

/dev/pts/7
11:34:26
#jobs

11:34:31
#iptables -D INPUT -p ICMP -j DROP

/dev/pts/8
11:34:31
#iptables -D INPUT -p ICMP -j DROP

/dev/pts/7
11:34:47
#iptables -I INPUT -i eth0 -p ICMP -j DROP

/dev/pts/8
11:34:47
#iptables -I INPUT -i eth0 -p ICMP -j DROP

11:35:10
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
--- 192.168.15.254 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
/dev/pts/7
11:35:10
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
--- 192.168.15.254 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
11:35:19
#arping 192.168.15.254
ARPING 192.168.15.254 from 192.168.15.4 eth0
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  2.329ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.019ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.021ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.023ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.023ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.012ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.026ms
Sent 7 probes (1 broadcast(s))
Received 7 response(s)
/dev/pts/8
11:35:19
#arping 192.168.15.254
ARPING 192.168.15.254 from 192.168.15.4 eth0
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  2.329ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.019ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.021ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.023ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.023ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.012ms
Unicast reply from 192.168.15.254 [00:1F:29:BC:3A:D8]  1.026ms
Sent 7 probes (1 broadcast(s))
Received 7 response(s)
11:35:53
#iptables -I INPUT -i eth0 -p ARP -j DROP
iptables v1.3.5: unknown protocol `arp' specified
Try `iptables -h' or 'iptables --help' for more information.
/dev/pts/7
11:35:53
#iptables -I INPUT -i eth0 -p ARP -j DROP
iptables v1.3.5: unknown protocol `arp' specified
Try `iptables -h' or 'iptables --help' for more information.
11:36:22
#iptables -I INPUT -i eth0 -p arp -j DROP
iptables v1.3.5: unknown protocol `arp' specified
Try `iptables -h' or 'iptables --help' for more information.
/dev/pts/8
11:36:22
#iptables -I INPUT -i eth0 -p arp -j DROP
iptables v1.3.5: unknown protocol `arp' specified
Try `iptables -h' or 'iptables --help' for more information.
/dev/tty2
11:37:28
#tcpdump -i eth0 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
15:38:11.774559 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 1, length 64
15:38:11.775139 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 1, length 64
15:38:12.774683 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 2, length 64
15:38:12.775218 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 2, length 64
15:38:13.775145 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 3, length 64
15:38:13.775595 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 3, length 64
15:38:14.775119 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 4, length 64
15:38:14.775731 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 4, length 64
...
15:38:20.775591 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 10, length 64
15:38:21.774957 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 11, length 64
15:38:21.775590 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 11, length 64
15:38:22.774953 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 12, length 64
15:38:22.775616 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 12, length 64
15:38:23.774906 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 13, length 64
15:38:23.775493 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 13, length 64
26 packets captured
28 packets received by filter
0 packets dropped by kernel
11:38:24
#tcpdump -i eth0 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
15:40:12.783766 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 122, length 64
15:40:12.784363 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 122, length 64
15:40:13.783572 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 123, length 64
15:40:13.784171 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 123, length 64
15:40:14.784435 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 124, length 64
15:40:14.785013 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 124, length 64
15:40:15.784651 IP 192.168.15.4 > 192.168.15.254: ICMP echo request, id 13104, seq 125, length 64
15:40:15.785299 IP 192.168.15.254 > 192.168.15.4: ICMP echo reply, id 13104, seq 125, length 64
...
17:41:49.332289 IP 192.168.15.4 > 192.168.15.6: ICMP echo reply, id 62268, seq 6, length 64
17:41:50.332234 IP 192.168.15.6 > 192.168.15.4: ICMP echo request, id 62268, seq 7, length 64
17:41:50.332276 IP 192.168.15.4 > 192.168.15.6: ICMP echo reply, id 62268, seq 7, length 64
17:41:51.332191 IP 192.168.15.6 > 192.168.15.4: ICMP echo request, id 62268, seq 8, length 64
17:41:51.332233 IP 192.168.15.4 > 192.168.15.6: ICMP echo reply, id 62268, seq 8, length 64
17:41:52.332152 IP 192.168.15.6 > 192.168.15.4: ICMP echo request, id 62268, seq 9, length 64
17:41:52.332193 IP 192.168.15.4 > 192.168.15.6: ICMP echo reply, id 62268, seq 9, length 64
732 packets captured
736 packets received by filter
0 packets dropped by kernel
/dev/pts/8
11:38:35
#iptables -p icmp -h | less
/dev/pts/7
11:38:35
#iptables -p icmp -h | less
11:39:43
#-j DROP

/dev/pts/8
11:39:43
#-j DROP

/dev/pts/7
11:39:54
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
--- 192.168.15.254 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms
/dev/pts/8
11:39:54
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
--- 192.168.15.254 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 3999ms
/dev/pts/7
11:40:13
#ping 192.168.15.254

/dev/pts/8
11:40:13
#ping 192.168.15.254

11:40:18
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=1.54 ms
64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.485 ms
--- 192.168.15.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.485/1.014/1.543/0.529 ms
/dev/pts/7
11:40:18
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=1.54 ms
64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.485 ms
--- 192.168.15.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.485/1.014/1.543/0.529 ms
11:40:21
#ping 192.168.15.254

11:40:21
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=1.03 ms
--- 192.168.15.254 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.035/1.035/1.035/0.000 ms
/dev/pts/8
11:40:21
#ping 192.168.15.254

11:40:21
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=1.03 ms
--- 192.168.15.254 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.035/1.035/1.035/0.000 ms
/dev/tty3
11:43:47
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data.
64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=0.572 ms
64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.500 ms
64 bytes from 192.168.15.254: icmp_seq=3 ttl=64 time=0.674 ms
64 bytes from 192.168.15.254: icmp_seq=4 ttl=64 time=0.498 ms
64 bytes from 192.168.15.254: icmp_seq=5 ttl=64 time=0.630 ms
64 bytes from 192.168.15.254: icmp_seq=6 ttl=64 time=0.500 ms
64 bytes from 192.168.15.254: icmp_seq=7 ttl=64 time=0.637 ms
64 bytes from 192.168.15.254: icmp_seq=8 ttl=64 time=0.538 ms
64 bytes from 192.168.15.254: icmp_seq=9 ttl=64 time=0.637 ms
...
64 bytes from 192.168.15.254: icmp_seq=42 ttl=64 time=0.504 ms
64 bytes from 192.168.15.254: icmp_seq=43 ttl=64 time=0.576 ms
64 bytes from 192.168.15.254: icmp_seq=44 ttl=64 time=0.501 ms
64 bytes from 192.168.15.254: icmp_seq=45 ttl=64 time=0.601 ms
64 bytes from 192.168.15.254: icmp_seq=46 ttl=64 time=0.528 ms
64 bytes from 192.168.15.254: icmp_seq=47 ttl=64 time=0.673 ms
64 bytes from 192.168.15.254: icmp_seq=48 ttl=64 time=0.571 ms
--- 192.168.15.254 ping statistics ---
48 packets transmitted, 48 received, 0% packet loss, time 47012ms
rtt min/avg/max/mdev = 0.465/0.563/0.688/0.070 ms
/dev/pts/7
11:44:52
#ping 192.168.15.1
PING 192.168.15.1 (192.168.15.1) 56(84) bytes of data.
--- 192.168.15.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
/dev/pts/8
11:44:52
#ping 192.168.15.1
PING 192.168.15.1 (192.168.15.1) 56(84) bytes of data.
--- 192.168.15.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
11:44:54
#ping 192.168.15.2
PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data.
64 bytes from 192.168.15.2: icmp_seq=1 ttl=64 time=1.83 ms
64 bytes from 192.168.15.2: icmp_seq=2 ttl=64 time=0.412 ms
--- 192.168.15.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.412/1.124/1.836/0.712 ms
/dev/pts/7
11:44:54
#ping 192.168.15.2
PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data.
64 bytes from 192.168.15.2: icmp_seq=1 ttl=64 time=1.83 ms
64 bytes from 192.168.15.2: icmp_seq=2 ttl=64 time=0.412 ms
--- 192.168.15.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.412/1.124/1.836/0.712 ms
/dev/tty3
11:45:00
#man arp
11:46:09
#arping 192.168.15.255
connect: Permission denied

Файлы

  • /proc/sys/net/ipv4/
  • /proc/sys/net/ipv4/ip_forward
  • /proc/sys/net/ipv4/
    >
    cipso_cache_bucket_size            tcp_dsack
    cipso_cache_enable                 tcp_ecn
    cipso_rbm_optfmt                   tcp_fack
    cipso_rbm_strictvalid              tcp_fin_timeout
    conf/                              tcp_frto
    icmp_echo_ignore_all               tcp_keepalive_intvl
    icmp_echo_ignore_broadcasts        tcp_keepalive_probes
    icmp_errors_use_inbound_ifaddr     tcp_keepalive_time
    icmp_ignore_bogus_error_responses  tcp_low_latency
    icmp_ratelimit                     tcp_max_orphans
    icmp_ratemask                      tcp_max_syn_backlog
    igmp_max_memberships               tcp_max_tw_buckets
    igmp_max_msf                       tcp_mem
    inet_peer_gc_maxtime               tcp_moderate_rcvbuf
    inet_peer_gc_mintime               tcp_mtu_probing
    inet_peer_maxttl                   tcp_no_metrics_save
    inet_peer_minttl                   tcp_orphan_retries
    inet_peer_threshold                tcp_reordering
    ip_conntrack_max                   tcp_retrans_collapse
    ip_default_ttl                     tcp_retries1
    ip_dynaddr                         tcp_retries2
    ip_forward                         tcp_rfc1337
    ipfrag_high_thresh                 tcp_rmem
    ipfrag_low_thresh                  tcp_sack
    ipfrag_max_dist                    tcp_slow_start_after_idle
    ipfrag_secret_interval             tcp_stdurg
    ipfrag_time                        tcp_synack_retries
    ip_local_port_range                tcp_syncookies
    ip_nonlocal_bind                   tcp_syn_retries
    ip_no_pmtu_disc                    tcp_timestamps
    neigh/                             tcp_tso_win_divisor
    netfilter/                         tcp_tw_recycle
    route/                             tcp_tw_reuse
    tcp_abc                            tcp_window_scaling
    tcp_abort_on_overflow              tcp_wmem
    tcp_adv_win_scale                  tcp_workaround_signed_windows
    tcp_app_win                        udp_mem
    tcp_base_mss                       udp_rmem_min
    tcp_congestion_control             udp_wmem_min
    tcp_dma_copybreak
    
    /proc/sys/net/ipv4/ip_forward
    >
    1
    

    Статистика

    Время первой команды журнала08:49:06 2010- 6- 9
    Время последней команды журнала11:46:09 2010- 6- 9
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, %16.83
    Процент синтаксически неверно набранных команд, % 1.98
    Суммарное время работы с терминалом *, час 1.36
    Количество командных строк в единицу времени, команда/мин 1.24
    Частота использования команд
    iptables42|====================================| 36.84%
    ping19|================| 16.67%
    cat8|=======| 7.02%
    kill6|=====| 5.26%
    grep5|====| 4.39%
    tail4|===| 3.51%
    less4|===| 3.51%
    man3|==| 2.63%
    arping3|==| 2.63%
    jobs3|==| 2.63%
    tcpdump2|=| 1.75%
    -j2|=| 1.75%
    /etc/init.d/iptables2|=| 1.75%
    iptables-save2|=| 1.75%
    netstat2|=| 1.75%
    iptales-save2|=| 1.75%
    ip2|=| 1.75%
    screen1|| 0.88%
    pkill1|| 0.88%
    who1|| 0.88%
    ____
    *) Интервалы неактивности длительностью 30 минут и более не учитываются

    Справка

    Для того чтобы использовать LiLaLo, не нужно знать ничего особенного: всё происходит само собой. Однако, чтобы ведение и последующее использование журналов было как можно более эффективным, желательно иметь в виду следующее:
    1. В журнал автоматически попадают все команды, данные в любом терминале системы.

    2. Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.

    3. Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
      $ l s-l
      bash: l: command not found
      

    4. Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
      $ test 5 -lt 4
      Обратите внимание на то, что код завершения команды может быть отличен от нуля не только в тех случаях, когда команда была выполнена с ошибкой. Многие команды используют код завершения, например, для того чтобы показать результаты проверки

    5. Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
      $ 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
      

    6. Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
      # id
      uid=0(root) gid=0(root) Gruppen=0(root)
      

    7. Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
      $ vi ~/.bashrc
      2a3,5
      >    if [ -f /usr/local/etc/bash_completion ]; then
      >         . /usr/local/etc/bash_completion
      >        fi
      

    8. Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
      $ patch ~/.bashrc
      В данном случае изменения применяются к файлу ~/.bashrc

    9. Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.

      Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.

    10. Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.

    11. Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора

    12. Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.

    13. Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.

    14. Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:

      $ whoami
      
      user
      
      $ #^ Интересно, кто я?
      
      в журнале это будет выглядеть так:
      $ whoami
      
      user
      
      Интересно, кто я?

    15. Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:

      $ whoami
      
      user
      
      $ cat > /dev/null #^ Интересно, кто я?
      
      Программа whoami выводит имя пользователя, под которым 
      мы зарегистрировались в системе.
      -
      Она не может ответить на вопрос о нашем назначении 
      в этом мире.
      
      В журнале это будет выглядеть так:
      $ whoami
      user
      
      Интересно, кто я?
      Программа whoami выводит имя пользователя, под которым
      мы зарегистрировались в системе.

      Она не может ответить на вопрос о нашем назначении
      в этом мире.
      Для разделения нескольких абзацев между собой используйте символ "-", один в строке.

    16. Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=

    17. Содержимое файла может быть показано в журнале. Для этого его нужно вывести с помощью программы cat. Если вывод команды отметить симоволами #!, содержимое файла будет показано в журнале в специально отведённой для этого секции.
    18. Для того чтобы вставить скриншот интересующего вас окна в журнал, нужно воспользоваться командой l3shot. После того как команда вызвана, нужно с помощью мыши выбрать окно, которое должно быть в журнале.
    19. Команды в журнале расположены в хронологическом порядке. Если две команды давались одна за другой, но на разных терминалах, в журнале они будут рядом, даже если они не имеют друг к другу никакого отношения.
      1
          2
      3   
          4
      
      Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.

    О программе

    LiLaLo (L3) расшифровывается как Live Lab Log.
    Программа разработана для повышения эффективности обучения Unix/Linux-системам.
    (c) Игорь Чубин, 2004-2008

    $Id$