/l3/users/29-05-2007/nt-lnet/linux1.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 |
|
#tcpdump
! .bash_profile .l3rc .profile .viminfo .aptitude/ .bashrc .lesshst q .w3m/ .bash_history install .lilalo/ .ssh/ wall |
#tcpdump cdp
tcpdump: WARNING: eth2: no IPv4 address assigned tcpdump: syntax error |
#man tcpdump
|
#tcpdump
tcpdump: WARNING: eth2: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth3
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes 09:30:05.190891 802.1d config 8000.00:04:c1:4d:37:d2.801d root 8000.00:04:c1:4d:37:d2 pathcost 0 age 0 max 20 hello 2 fdelay 15 1 packets captured 1 packets received by filter 0 packets dropped by kernel |
#tcpdump cdp -i eth3
tcpdump: syntax error |
#tcpdump
tcpdump: syntax error |
#tcpdump -i eth3
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes ^@ 09:30:29.514351 arp who-has 192.168.16.15 tell linux1.local 1 packets captured 15 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth3p -i eth3
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes c 09:30:54.703246 arp who-has 192.168.16.15 tell linux1.local 1 packets captured 14 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth3
09:31:45.921027 arp who-has 192.168.16.15 tell linux1.local 09:31:46.921060 arp who-has 192.168.16.15 tell linux1.local 09:31:49.921166 arp who-has 192.168.16.15 tell linux1.local 09:31:50.921202 arp who-has 192.168.16.15 tell linux1.local 09:31:51.921242 arp who-has 192.168.16.15 tell linux1.local 09:31:54.925340 arp who-has 192.168.16.15 tell linux1.local 09:31:55.029476 IP linux1.local.mdns > 224.0.0.251.mdns: 0 PTR? 15.16.168.192.in-addr.arpa. (44) 09:31:55.925378 arp who-has 192.168.16.15 tell linux1.local 09:31:56.033522 IP linux1.local.mdns > 224.0.0.251.mdns: 0 PTR? 15.16.168.192.in-addr.arpa. (44) 09:31:56.925416 arp who-has 192.168.16.15 tell linux1.local ... 09:35:21.480659 arp who-has 192.168.16.15 tell linux1.local 09:35:24.480773 arp who-has 192.168.16.15 tell linux1.local 09:35:25.480797 arp who-has 192.168.16.15 tell linux1.local 09:35:26.480838 arp who-has 192.168.16.15 tell linux1.local 09:35:29.480949 arp who-has 192.168.16.15 tell linux1.local 09:35:30.480977 arp who-has 192.168.16.15 tell linux1.local 09:35:31.481013 arp who-has 192.168.16.15 tell linux1.local 146 packets captured 146 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth3
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes 09:37:47.575729 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:49.489898 arp who-has 192.168.16.15 tell linux1.local 09:37:49.579598 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:50.489938 arp who-has 192.168.16.15 tell linux1.local 09:37:51.489985 arp who-has 192.168.16.15 tell linux1.local 09:37:51.581801 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:53.584509 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:54.494086 arp who-has 192.168.16.15 tell linux1.local 09:37:55.494115 arp who-has 192.168.16.15 tell linux1.local 09:37:55.587689 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:56.494144 arp who-has 192.168.16.15 tell linux1.local 09:37:57.590362 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 09:37:59.494264 arp who-has 192.168.16.15 tell linux1.local 09:37:59.592637 802.1d config 8000.00:04:c1:4d:37:c0.801d root 8000.00:04:c1:4d:37:c0 pathcost 0 age 0 max 20 hello 2 fdelay 15 c09:37:59.598424 IP linux1.local.mdns > 224.0.0.251.mdns: 0 PTR? 15.16.168.192.in-addr.arpa. (44) 15 packets captured 70 packets received by filter 0 packets dropped by kernel |
#c
|
#tcpdump cdp -i eth3
tcpdump: syntax error |
#apt-get install ethereal
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Уже установлена самая новая версия ethereal. обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено. |
#sudo wireshark
(wireshark:3653): Gtk-WARNING **: cannot open display: |
#wireshark
(wireshark:3665): Gtk-WARNING **: cannot open display: |
#vim /etc/sudoers
|
$sudo wireshark
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: Sorry, try again. Password: Sorry, try again. Password: user is not in the sudoers file. This incident will be reported. |
$sudo wireshark
|
#nmap 192.168.16.0/24
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2007-05-31 09:41 EEST Interesting ports on 192.168.16.1: Not shown: 1674 closed ports PORT STATE SERVICE 7/tcp open echo 22/tcp open ssh 80/tcp open http 111/tcp open rpcbind 113/tcp open auth 2628/tcp open dict ... MAC Address: 00:D0:B7:CD:1B:CF (Intel) Interesting ports on 192.168.16.5: Not shown: 1676 closed ports PORT STATE SERVICE 135/tcp open msrpc 139/tcp open netbios-ssn 445/tcp open microsoft-ds 3389/tcp open ms-term-serv MAC Address: 00:D0:59:34:B2:F5 (Ambit Microsystems) Nmap finished: 256 IP addresses (3 hosts up) scanned in 33.267 seconds |
#ifconfig eth3:1 10.1.2.1/24 up
SIOCSIFNETMASK: Cannot assign requested address |
#ifconfig eth3:1 10.1.2.1/8 up
|
#ping 10.1.2.10
PING 10.1.2.10 (10.1.2.10) 56(84) bytes of data. 64 bytes from 10.1.2.10: icmp_seq=2 ttl=255 time=1.26 ms 64 bytes from 10.1.2.10: icmp_seq=3 ttl=255 time=1.24 ms --- 10.1.2.10 ping statistics --- 3 packets transmitted, 2 received, 33% packet loss, time 2000ms rtt min/avg/max/mdev = 1.248/1.254/1.260/0.006 ms |
#telnet 10.1.2.10
Trying 10.1.2.10... Connected to 10.1.2.10. Escape character is '^]'. User Access Verification Password: Password: Password: % Bad passwords Connection closed by foreign host. |
#telnet 10.1.2.10
! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 shutdown switchport trunk encapsulation dot1q switchport mode trunk ! ... 51 Sergi_51 active 52 VLAN0052 active 53 VLAN0053 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active wg_sw_b#reload Proceed with reload? [confirm] Connection closed by foreign host. |
$su -
Connection to net.nt closed. [root@linux1:~]# [root@linux1:~]# [root@linux1:~]# Password: l3-agent is already running: pid=3166; pidfile=/root/.lilalo/l3-agent.pid target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE 0 -- 192.168.15.0/24 anywhere MASQUERADE 0 -- 192.168.16.0/24 anywhere MASQUERADE 0 -- 10.0.17.0/24 anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination clint~$ -------------------------------------------------------------------------------- |
#man modprobe
|
#ifconfig eth3 down
|
#ifconfig eth3 0.0.0.0/24 up
|
#ifconfig eth3 192.168.17.1/24 up
SIOCSIFNETMASK: Cannot assign requested address |
#ifconfig eth3 down
|
#ifconfig eth3 192.168.16.1/24 up
|
#ifconfig
eth2 Link encap:Ethernet HWaddr 00:04:76:A1:F0:A5 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:185 eth3 Link encap:Ethernet HWaddr 00:90:27:35:58:F2 inet addr:192.168.16.1 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::290:27ff:fe35:58f2/64 Scope:Link ... inet addr:10.1.2.1 Bcast:10.255.255.255 Mask:255.0.0.0 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:3810 errors:0 dropped:0 overruns:0 frame:0 TX packets:3810 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:178909 (174.7 KiB) TX bytes:178909 (174.7 KiB) |
#ifconfig eth3 down
|
#ifconfig eth3 192.168.16.2/24 up
|
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. 64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=5.73 ms 64 bytes from 192.168.16.1: icmp_seq=2 ttl=64 time=0.276 ms 64 bytes from 192.168.16.1: icmp_seq=3 ttl=64 time=0.241 ms 64 bytes from 192.168.16.1: icmp_seq=4 ttl=64 time=0.241 ms ^@64 bytes from 192.168.16.1: icmp_seq=5 ttl=64 time=0.236 ms --- 192.168.16.1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4001ms rtt min/avg/max/mdev = 0.236/1.345/5.733/2.194 ms |
#ping 192.168.15.1
connect: Network is unreachable |
#route -a
route: invalid option -- a Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.19.0 * 255.255.255.0 U 0 0 0 eth3 192.168.16.0 * 255.255.255.0 U 0 0 0 eth3 10.0.0.0 * 255.0.0.0 U 0 0 0 eth3 |
#route add default gw 192.168.16.1
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.19.0 * 255.255.255.0 U 0 0 0 eth3 192.168.16.0 * 255.255.255.0 U 0 0 0 eth3 10.0.0.0 * 255.0.0.0 U 0 0 0 eth3 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.19.0 * 255.255.255.0 U 0 0 0 eth3 192.168.16.0 * 255.255.255.0 U 0 0 0 eth3 10.0.0.0 * 255.0.0.0 U 0 0 0 eth3 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.19.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth3 0.0.0.0 192.168.16.1 0.0.0.0 UG 0 0 0 eth3 |
#ping 192.168.15.1
PING 192.168.15.1 (192.168.15.1) 56(84) bytes of data. 64 bytes from 192.168.15.1: icmp_seq=1 ttl=64 time=3.00 ms 64 bytes from 192.168.15.1: icmp_seq=2 ttl=64 time=0.220 ms 64 bytes from 192.168.15.1: icmp_seq=3 ttl=64 time=0.239 ms --- 192.168.15.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.220/1.155/3.008/1.310 ms |
#ping 192.168.3.1
PING 192.168.3.1 (192.168.3.1) 56(84) bytes of data. 64 bytes from 192.168.3.1: icmp_seq=1 ttl=64 time=0.280 ms 64 bytes from 192.168.3.1: icmp_seq=2 ttl=64 time=0.215 ms 64 bytes from 192.168.3.1: icmp_seq=3 ttl=64 time=0.243 ms --- 192.168.3.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 0.215/0.246/0.280/0.026 ms |
#ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.263 ms 64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.246 ms --- 192.168.2.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 0.246/0.254/0.263/0.018 ms |
#ping mail.ru
|
#ping 192.168.3.2
PING 192.168.3.2 (192.168.3.2) 56(84) bytes of data. 64 bytes from 192.168.3.2: icmp_seq=1 ttl=63 time=0.456 ms 64 bytes from 192.168.3.2: icmp_seq=2 ttl=63 time=0.381 ms 64 bytes from 192.168.3.2: icmp_seq=3 ttl=63 time=0.392 ms --- 192.168.3.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.381/0.409/0.456/0.040 ms |
#ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.282 ms --- 192.168.2.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.282/0.282/0.282/0.000 ms |
#ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data. 64 bytes from 192.168.2.2: icmp_seq=1 ttl=63 time=0.482 ms --- 192.168.2.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.482/0.482/0.482/0.000 ms |
#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=63 time=0.542 ms --- 192.168.15.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.542/0.542/0.542/0.000 ms |
#ping mail.ru
|
#ifconfig
eth2 Link encap:Ethernet HWaddr 00:04:76:A1:F0:A5 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:185 eth3 Link encap:Ethernet HWaddr 00:90:27:35:58:F2 inet addr:192.168.16.2 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::290:27ff:fe35:58f2/64 Scope:Link ... inet addr:10.1.2.1 Bcast:10.255.255.255 Mask:255.0.0.0 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:3857 errors:0 dropped:0 overruns:0 frame:0 TX packets:3857 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:182731 (178.4 KiB) TX bytes:182731 (178.4 KiB) |
#traceroute 192.168.15.2
traceroute to 192.168.15.2 (192.168.15.2), 30 hops max, 40 byte packets |
#ping mail.ru
|
#nslookup mail.ru
;; connection timed out; no servers could be reached |
$su -
Password: l3-agent is already running: pid=3166; pidfile=/root/.lilalo/l3-agent.pid |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP icmp -- anywhere localhost Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ping mail.ru
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=105 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=2 ttl=112 time=103 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=3 ttl=112 time=104 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=4 ttl=112 time=103 ms 64 bytes from mail.ru (194.67.57.26): icmp_seq=5 ttl=112 time=104 ms --- mail.ru ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4012ms rtt min/avg/max/mdev = 103.434/104.275/105.282/0.660 ms |
#traceroute 192.168.15.2
traceroute to 192.168.15.2 (192.168.15.2), 30 hops max, 40 byte packets 1 linux1 (192.168.16.1) 0.269 ms 0.258 ms 0.208 ms 2 192.168.15.2 (192.168.15.2) 0.417 ms 0.706 ms 0.395 ms |
#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=63 time=5.64 ms 64 bytes from 192.168.15.2: icmp_seq=2 ttl=63 time=0.576 ms 64 bytes from 192.168.15.2: icmp_seq=3 ttl=63 time=0.601 ms 64 bytes from 192.168.15.2: icmp_seq=4 ttl=63 time=0.412 ms 64 bytes from 192.168.15.2: icmp_seq=5 ttl=63 time=0.477 ms 64 bytes from 192.168.15.2: icmp_seq=6 ttl=63 time=0.534 ms 64 bytes from 192.168.15.2: icmp_seq=7 ttl=63 time=0.598 ms 64 bytes from 192.168.15.2: icmp_seq=8 ttl=63 time=0.400 ms 64 bytes from 192.168.15.2: icmp_seq=9 ttl=63 time=0.555 ms 64 bytes from 192.168.15.2: icmp_seq=10 ttl=63 time=0.526 ms 64 bytes from 192.168.15.2: icmp_seq=11 ttl=63 time=0.595 ms 64 bytes from 192.168.15.2: icmp_seq=12 ttl=63 time=0.677 ms 64 bytes from 192.168.15.2: icmp_seq=13 ttl=63 time=0.468 ms --- 192.168.15.2 ping statistics --- 13 packets transmitted, 13 received, 0% packet loss, time 12001ms rtt min/avg/max/mdev = 0.400/0.928/5.648/1.364 ms |
#traceroute 192.168.15.2
traceroute to 192.168.15.2 (192.168.15.2), 30 hops max, 40 byte packets 1 linux1 (192.168.16.1) 0.284 ms 0.255 ms 0.202 ms 2 192.168.15.2 (192.168.15.2) 0.335 ms 0.709 ms 0.391 ms |
#ping 192.168.15.2
PING 192.168.15.2 (192.168.15.2) 56(84) bytes of data. From 192.168.16.1 icmp_seq=1 Destination Port Unreachable From 192.168.16.1 icmp_seq=2 Destination Port Unreachable From 192.168.16.1 icmp_seq=3 Destination Port Unreachable From 192.168.16.1 icmp_seq=4 Destination Port Unreachable From 192.168.16.1 icmp_seq=5 Destination Port Unreachable From 192.168.16.1 icmp_seq=6 Destination Port Unreachable From 192.168.16.1 icmp_seq=7 Destination Port Unreachable From 192.168.16.1 icmp_seq=8 Destination Port Unreachable From 192.168.16.1 icmp_seq=9 Destination Port Unreachable ... From 192.168.16.1 icmp_seq=39 Destination Port Unreachable From 192.168.16.1 icmp_seq=40 Destination Port Unreachable From 192.168.16.1 icmp_seq=41 Destination Port Unreachable From 192.168.16.1 icmp_seq=42 Destination Port Unreachable From 192.168.16.1 icmp_seq=43 Destination Port Unreachable From 192.168.16.1 icmp_seq=44 Destination Port Unreachable From 192.168.16.1 icmp_seq=45 Destination Port Unreachable From 192.168.16.1 icmp_seq=46 Destination Port Unreachable --- 192.168.15.2 ping statistics --- 46 packets transmitted, 0 received, +46 errors, 100% packet loss, time 45016ms |
#tcpdump icmp
tcpdump: WARNING: eth2: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth3 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes 10:26:07.245796 IP linux1.net.nt > linux2.net.nt: ICMP echo request, id 21006, seq 1, length 64 10:26:07.249074 IP linux2.net.nt > linux1.net.nt: ICMP echo reply, id 21006, seq 1, length 64 10:26:07.245938 IP linux1.net.nt > linux2.net.nt: ICMP linux1.net.nt protocol 1 port 14672 unreachable, length 92 10:26:08.245191 IP linux1.net.nt > linux2.net.nt: ICMP echo request, id 21006, seq 2, length 64 10:26:08.245231 IP linux2.net.nt > linux1.net.nt: ICMP echo reply, id 21006, seq 2, length 64 10:26:08.245404 IP linux1.net.nt > linux2.net.nt: ICMP linux1.net.nt protocol 1 port 59984 unreachable, length 92 10:26:09.245176 IP linux1.net.nt > linux2.net.nt: ICMP echo request, id 21006, seq 3, length 64 10:26:09.245224 IP linux2.net.nt > linux1.net.nt: ICMP echo reply, id 21006, seq 3, length 64 ... 10:26:12.245346 IP linux1.net.nt > linux2.net.nt: ICMP linux1.net.nt protocol 1 port 76 unreachable, length 92 10:26:13.245111 IP linux1.net.nt > linux2.net.nt: ICMP echo request, id 21006, seq 7, length 64 10:26:13.245158 IP linux2.net.nt > linux1.net.nt: ICMP echo reply, id 21006, seq 7, length 64 10:26:13.245340 IP linux1.net.nt > linux2.net.nt: ICMP linux1.net.nt protocol 1 port 51018 unreachable, length 92 10:26:14.245090 IP linux1.net.nt > linux2.net.nt: ICMP echo request, id 21006, seq 8, length 64 10:26:14.245135 IP linux2.net.nt > linux1.net.nt: ICMP echo reply, id 21006, seq 8, length 64 10:26:14.245309 IP linux1.net.nt > linux2.net.nt: ICMP linux1.net.nt protocol 1 port 36425 unreachable, length 92 24 packets captured 24 packets received by filter 0 packets dropped by kernel |
#screen -x
|
#iptables -L -v
Chain INPUT (policy ACCEPT 432 packets, 29602 bytes) pkts bytes target prot opt in out source destination 4 336 DROP icmp -- any any anywhere localhost Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 372 packets, 69066 bytes) pkts bytes target prot opt in out source destination |
#iptables -L -v -v
Chain INPUT (policy ACCEPT 471 packets, 31774 bytes) pkts bytes target prot opt in out source destination 4 336 DROP icmp -- any any anywhere localhost Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 423 packets, 85430 bytes) pkts bytes target prot opt in out source destination |
#iptables -L INPUT -v -v
Chain INPUT (policy ACCEPT 590 packets, 38842 bytes) pkts bytes target prot opt in out source destination 4 336 DROP icmp -- any any anywhere localhost |
#man iptables
|
#iptables -L INPUT --lines-number
iptables v1.3.6: Unknown arg `--lines-number' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L INPUT --lines-numbers
iptables v1.3.6: Unknown arg `--lines-numbers' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -L INPUT --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination |
#iptables -L INPUT --line-numbers -v -v
Chain INPUT (policy ACCEPT 978 packets, 67150 bytes) num pkts bytes target prot opt in out source destination |
#iptables -L --line-numbers -v -v
Chain INPUT (policy ACCEPT 982 packets, 67470 bytes) num pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 998 packets, 227K bytes) num pkts bytes target prot opt in out source destination |
#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 -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 -d 127.0.0.1 -p icmp -j DROP
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination DROP icmp -- anywhere localhost Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 DROP icmp -- anywhere localhost Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#iptables -L --line-numbers -vv
Chain INPUT (policy ACCEPT 1051 packets, 72285 bytes) num pkts bytes target prot opt in out source destination 1 0 0 DROP icmp -- any any anywhere localhost Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 1098 packets, 239K bytes) num pkts bytes target prot opt in out source destination |
#ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. --- 127.0.0.1 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 1999ms |
#ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. --- 127.0.0.1 ping statistics --- 45 packets transmitted, 0 received, 100% packet loss, time 44028ms |
#iptables -d INPUT -d 127.0.0.1 -p icmp -j DROP
iptables v1.3.6: multiple -d flags not allowed Try `iptables -h' or 'iptables --help' for more information. |
#iptables -D INPUT -d 127.0.0.1 -p icmp -j DROP
iptables: Bad rule (does a matching rule exist in that chain?) |
#iptables -A INPUT -d 127.0.0.1 -p icmp -j DROP
|
#iptables -L --line-numbers -vv
Chain INPUT (policy ACCEPT 1080 packets, 74869 bytes) num pkts bytes target prot opt in out source destination 1 0 0 DROP icmp -- any any anywhere localhost Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 1196 packets, 246K bytes) num pkts bytes target prot opt in out source destination |
#iptables -D INPUT -d 127.0.0.1 -p icmp -j DROP
|
#iptables -L --line-numbers -vv
Chain INPUT (policy ACCEPT 1080 packets, 74869 bytes) num pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 1196 packets, 246K bytes) num pkts bytes target prot opt in out source destination |
#iptables -F INPUT
|
#ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.098 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.057 ms --- 127.0.0.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.057/0.077/0.098/0.022 ms |
#iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
#w
11:06:10 up 1:40, 6 users, load average: 0,95, 0,61, 0,43 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user :0 - 09:27 ?xdm? 3:34m 1.01s x-session-manager user pts/0 :0.0 09:58 21.00s 0.30s 0.26s script -f -q /home/user/.lilalo//1037920422313926437-118059468 user pts/3 :0.0 09:40 1:25 0.24s 0.24s script -f -q /home/user/.lilalo//1793719166289054487-118059362 root pts/5 linux2.net.nt 09:48 1:16 0.04s 0.03s script -f -q /root/.lilalo//18827125761041826333-1180594114.sc user pts/7 :0.0 10:19 0.00s 0.35s 0.25s script -f -q /home/user/.lilalo//200282635631205974-1180595950 root pts/12 192.168.16.1 10:37 14:21m 0.02s 0.02s script -f -q /root/.lilalo//23625158732750026259-1180597032.sc |
#iptables -A INPUT -p tcp -j DROP
|
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT tcp -- anywhere anywhere tcp dpt:ssh DROP tcp -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -L --line-numbers
Chain INPUT (policy ACCEPT) num target prot opt source destination 1 ACCEPT tcp -- anywhere anywhere tcp dpt:www 2 ACCEPT tcp -- anywhere anywhere tcp dpt:ssh 3 DROP tcp -- anywhere anywhere Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. 64 bytes from 192.168.16.1: icmp_seq=1 ttl=64 time=0.314 ms --- 192.168.16.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.314/0.314/0.314/0.000 ms |
Время первой команды журнала | 09:28:32 2007- 5-31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 11:05:28 2007- 5-31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.79 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.62 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.04 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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