/l3/users/igor-public/nt-scale-2010-03/linux10.unix.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
#dd if=/dev/urandom of=/dev/null count=100 bs=1024k
^C26+1 records in 26+0 records out 27262976 bytes (27 MB) copied, 6.47069 s, 4.2 MB/s |
#dd if=/dev/urandom of=/dev/null count=5 bs=1024k
5+0 records in 5+0 records out 5242880 bytes (5.2 MB) copied, 1.21914 s, 4.3 MB/s |
#modprobe kqemu
|
#apt-get install kvm-source
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: kvm-source 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 160kB of archives. After this operation, 217kB of additional disk space will be used. Get:1 http://security.debian.org lenny/updates/main kvm-source 72+dfsg-5~lenny5 [160kB] Fetched 160kB in 0s (193kB/s) Selecting previously deselected package kvm-source. (Reading database ... 102347 files and directories currently installed.) Unpacking kvm-source (from .../kvm-source_72+dfsg-5~lenny5_all.deb) ... Setting up kvm-source (72+dfsg-5~lenny5) ... |
#lsmod | less
|
#man qemu
|
#dpkg -l kqemu-common
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==========================-==========================-==================================================================== ii kqemu-common 1.3.0~pre11-8 Common files for the QEMU Accelerator module |
#dpkg -L kqemu-common
/. /usr /usr/share /usr/share/doc /usr/share/doc/kqemu-common /usr/share/doc/kqemu-common/kqemu-doc.html /usr/share/doc/kqemu-common/kqemu-tech.html /usr/share/doc/kqemu-common/copyright /usr/share/doc/kqemu-common/changelog.Debian.gz /usr/share/doc/kqemu-common/changelog.gz /etc /etc/modprobe.d /etc/modprobe.d/kqemu |
#Ò
|
#set -o ignoreeof
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.15.10 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21b:fcff:fe7d:bb1e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:27343298 errors:0 dropped:0 overruns:0 frame:0 TX packets:41677110 errors:0 dropped:0 overruns:0 carrier:1 collisions:0 txqueuelen:1000 RX bytes:372701775 (355.4 MiB) TX bytes:853464489 (813.9 MiB) eth1 Link encap:Ethernet HWaddr 00:07:e9:0c:4f:a1 UP BROADCAST MULTICAST MTU:1500 Metric:1 ... collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:44340 errors:0 dropped:0 overruns:0 frame:0 TX packets:44340 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3881136 (3.7 MiB) TX bytes:3881136 (3.7 MiB) |
#brctl
Usage: brctl [commands] commands: addbr <bridge> add bridge delbr <bridge> delete bridge addif <bridge> <device> add interface to bridge delif <bridge> <device> delete interface from bridge setageing <bridge> <time> set ageing time setbridgeprio <bridge> <prio> set bridge priority setfd <bridge> <time> set bridge forward delay sethello <bridge> <time> set hello time setmaxage <bridge> <time> set max message age setpathcost <bridge> <port> <cost> set path cost setportprio <bridge> <port> <prio> set port priority show show a list of bridges showmacs <bridge> show a list of mac addrs showstp <bridge> show bridge stp info stp <bridge> {on|off} turn stp on/off |
##apt-get install bridge-utils
|
#brctl addbr br0
|
#brctl show
bridge name bridge id STP enabled interfaces br0 8000.000000000000 no |
#ifconfig br0 192.168.16.10
|
#ping 192.168.16.10
PING 192.168.16.10 (192.168.16.10) 56(84) bytes of data. 64 bytes from 192.168.16.10: icmp_seq=1 ttl=64 time=0.020 ms ^C --- 192.168.16.10 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.020/0.020/0.020/0.000 ms |
#vi /etc/qemu-ifup
--- /tmp/l3-saved-843.2007.24969 2010-03-24 14:19:00.000000000 +0200 +++ /etc/qemu-ifup 2010-03-24 14:19:28.000000000 +0200 @@ -1,2 +1,3 @@ #!/bin/sh -sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 +#sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 +brctl addbr br0 $1 |
#chmod +x /etc/qemu-ifup
|
#cat /etc/qemu-ifup
#!/bin/sh #sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 brctl addbr br0 $1 |
#cat /etc/qemu-ifup
#!/bin/sh #sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 brctl addbr br0 $1 |
#sed -i s/addbr/addif/ /etc/qemu-ifup
|
#vi /etc/qemu-ifup
--- /tmp/l3-saved-843.12865.17520 2010-03-24 14:38:05.000000000 +0200 +++ /etc/qemu-ifup 2010-03-24 14:38:11.000000000 +0200 @@ -1,3 +1,5 @@ #!/bin/sh #sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 brctl addif br0 $1 +ifconfig $1 up + |
#cat /etc/qemu-ifup
#!/bin/sh #sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 brctl addif br0 $1 ifconfig $1 up |
## iptables -t nat -A POSTROUTING -j MASQUERADE
|
#brctl show
bridge name bridge id STP enabled interfaces br0 8000.000000000000 no |
#ssh 192.168.15.254
10.0.1.13 00155d-e7ab32 dynamic 40 10.0.13.1 0007e9-3c2a3d dynamic 40 10.0.35.1 00163e-040001 dynamic 40 10.0.35.9 000475-825343 dynamic 10.0.40.203 000c29-d59f7c dynamic 40 10.0.40.223 000c29-5057c4 dynamic 40 ProCurve Switch 3400cl-48G# conf ProCurve Switch 3400cl-48G(config)# vlan 16 tagged 19,22,28,2,31,39 ProCurve Switch 3400cl-48G(config)# vlan 16 ip address 192.168.16.254 Incomplete input: 192.168.16.254 ProCurve Switch 3400cl-48G(config)# vlan 16 ip address 192.168.16.254 255.255.255.0 The IP address (or subnet) 192.168.16.254/24 already exists. ProCurve Switch 3400cl-48G(config)# sh run Running configuration: ; J4906A Configuration Editor; Created on release #M.10.41 hostname "ProCurve Switch 3400cl-48G" Connection to 192.168.15.254 closed by remote host. |
#apt-get install vlan
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: vlan 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 39.6kB of archives. After this operation, 176kB of additional disk space will be used. Get:1 http://10.0.35.1 lenny/main vlan 1.9-3 [39.6kB] Fetched 39.6kB in 0s (962kB/s) Selecting previously deselected package vlan. (Reading database ... 102354 files and directories currently installed.) Unpacking vlan (from .../archives/vlan_1.9-3_i386.deb) ... Processing triggers for man-db ... Setting up vlan (1.9-3) ... |
#vconfig add eth0 16
WARNING: Could not open /proc/net/vlan/config. Maybe you need to load the 8021q module, or maybe you are not using PROCFS?? Added VLAN with VID == 16 to IF -:eth0:- |
#ifconfig eth0.16
eth0.16 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e 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:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
#ifconfig eth0.16 192.168.16.10
|
#ifconfig eth0.16 0.0.0.0
|
#brctl addif br0 eth0.16
|
#ifconfig br0
br0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.16.10 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::e4f2:76ff:feb3:223a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:35 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:6407 (6.2 KiB) |
#ping 192.168.16.254
PING 192.168.16.254 (192.168.16.254) 56(84) bytes of data. From 192.168.16.10 icmp_seq=1 Destination Host Unreachable From 192.168.16.10 icmp_seq=2 Destination Host Unreachable From 192.168.16.10 icmp_seq=3 Destination Host Unreachable ^C --- 192.168.16.254 ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3016ms , pipe 3 |
#brctl show
bridge name bridge id STP enabled interfaces br0 8000.001bfc7dbb1e no eth0.16 |
#ip route show
192.168.16.0/24 dev br0 proto kernel scope link src 192.168.16.10 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.10 default via 192.168.15.254 dev eth0 |
#ssh 192.168.15.254
Connection to 192.168.15.254 closed by remote host. |
#tcpdump -i br0 -n
bash: tcpdump: command not found |
#apt-get install tcpdump
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tcpdump 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 306kB of archives. After this operation, 631kB of additional disk space will be used. Get:1 http://10.0.35.1 lenny/main tcpdump 3.9.8-4 [306kB] Fetched 306kB in 0s (10.3MB/s) Selecting previously deselected package tcpdump. (Reading database ... 102368 files and directories currently installed.) Unpacking tcpdump (from .../tcpdump_3.9.8-4_i386.deb) ... Processing triggers for man-db ... Setting up tcpdump (3.9.8-4) ... |
#tcpdump -i eth0.16 -n
tcpdump: WARNING: eth0.16: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0.16, link-type EN10MB (Ethernet), capture size 96 bytes ^C 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n vlan 16
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes ^C 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#ssh 192.168.15.254
ProCurve Switch 3400cl-48G# ProCurve Switch 3400cl-48G# ProCurve Switch 3400cl-48G# ping 192.168.16.1 Request timed out. tagged 2,19,22,28,31,39 exit vlan 17 name "VLAN17" ip address 192.168.17.254 255.255.255.0 exit ... exit vlan 17 name "VLAN17" ip address 192.168.17.254 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 10.0.35.1 ip ssh Rebooting the System Read from remote host 192.168.15.254: Connection reset by peer Connection to 192.168.15.254 closed. |
#tcpdump -i eth0 -n not port 22
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:06:54.584585 IP 192.168.15.10.7790 > 192.168.15.1.44600: P 3344878242:3344878786(544) ack 3134059088 win 3072 <nop,nop,timestamp 44345384 5167819> 15:06:54.584789 IP 192.168.15.1.44600 > 192.168.15.10.7790: . ack 544 win 3055 <nop,nop,timestamp 5168047 44345384> 15:06:54.585381 IP 192.168.15.1.7790 > 192.168.15.10.42121: P 2669962566:2669962598(32) ack 2749036201 win 24531 <nop,nop,timestamp 5168048 44345155> 15:06:54.585404 IP 192.168.15.10.7790 > 192.168.15.1.44600: P 544:552(8) ack 1 win 3072 <nop,nop,timestamp 44345384 5168047> 15:06:54.585417 IP 192.168.15.10.42121 > 192.168.15.1.7790: . ack 32 win 24531 <nop,nop,timestamp 44345384 5168048> 15:06:54.585453 IP 192.168.15.10.7790 > 192.168.15.1.44600: P 552:568(16) ack 1 win 3072 <nop,nop,timestamp 44345384 5168047> 15:06:54.585789 IP 192.168.15.1.44600 > 192.168.15.10.7790: . ack 552 win 3072 <nop,nop,timestamp 5168048 44345384> 15:06:54.585790 IP 192.168.15.1.44600 > 192.168.15.10.7790: . ack 568 win 3072 <nop,nop,timestamp 5168048 44345384> ... 15:06:55.665446 IP 192.168.15.10.7790 > 192.168.15.1.44600: . ack 553 win 3055 <nop,nop,timestamp 44345654 5168318> 15:06:55.665595 IP 192.168.15.10.42121 > 192.168.15.1.7790: P 1:33(32) ack 48 win 24531 <nop,nop,timestamp 44345654 5168048> 15:06:55.665839 IP 192.168.15.1.44600 > 192.168.15.10.7790: P 553:569(16) ack 568 win 3072 <nop,nop,timestamp 5168318 44345654> 15:06:55.665849 IP 192.168.15.10.7790 > 192.168.15.1.44600: . ack 569 win 3055 <nop,nop,timestamp 44345654 5168318> 15:06:55.665862 IP 192.168.15.10.42121 > 192.168.15.1.7790: P 33:49(16) ack 48 win 24531 <nop,nop,timestamp 44345654 5168048> 15:06:55.666043 IP 192.168.15.1.7790 > 192.168.15.10.42121: . ack 49 win 24531 <nop,nop,timestamp 5168318 44345654> ^C 43 packets captured 43 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n not port 22 and not port 7790
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:07:02.737122 IP 192.168.15.10.7789 > 192.168.15.1.38382: P 1851525130:1851525674(544) ack 4289427386 win 3072 <nop,nop,timestamp 44347422 5169817> 15:07:02.737329 IP 192.168.15.1.38382 > 192.168.15.10.7789: . ack 544 win 3055 <nop,nop,timestamp 5170085 44347422> 15:07:02.737923 IP 192.168.15.10.7789 > 192.168.15.1.38382: P 544:552(8) ack 1 win 3072 <nop,nop,timestamp 44347422 5170085> 15:07:02.738139 IP 192.168.15.1.38382 > 192.168.15.10.7789: . ack 552 win 3072 <nop,nop,timestamp 5170086 44347422> 15:07:02.738342 IP 192.168.15.1.7789 > 192.168.15.10.55630: P 4098144255:4098144287(32) ack 4143780493 win 6178 <nop,nop,timestamp 5170086 44347153> 15:07:02.738418 IP 192.168.15.10.55630 > 192.168.15.1.7789: . ack 32 win 24531 <nop,nop,timestamp 44347422 5170086> 15:07:02.740080 IP 192.168.15.10.7789 > 192.168.15.1.38382: P 552:568(16) ack 1 win 3072 <nop,nop,timestamp 44347423 5170086> 15:07:02.740387 IP 192.168.15.1.38382 > 192.168.15.10.7789: . ack 568 win 3072 <nop,nop,timestamp 5170086 44347423> ... 15:07:03.666897 IP 192.168.15.10.7789 > 192.168.15.1.38382: . ack 569 win 3055 <nop,nop,timestamp 44347654 5170318> 15:07:03.666945 IP 192.168.15.10.55630 > 192.168.15.1.7789: P 33:49(16) ack 48 win 24531 <nop,nop,timestamp 44347654 5170318> 15:07:03.667087 IP 192.168.15.1.7789 > 192.168.15.10.55630: . ack 49 win 6178 <nop,nop,timestamp 5170318 44347654> 15:07:03.875156 IP 192.168.15.10.46326 > 192.168.15.1.3260: P 594173096:594173144(48) ack 451819504 win 216 <nop,nop,timestamp 44347707 5169120> 15:07:03.875377 IP 192.168.15.1.3260 > 192.168.15.10.46326: P 1:49(48) ack 48 win 215 <nop,nop,timestamp 5170370 44347707> 15:07:03.875392 IP 192.168.15.10.46326 > 192.168.15.1.3260: . ack 49 win 216 <nop,nop,timestamp 44347707 5170370> ^C 27 packets captured 27 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n not port 22 and not port 7790 and not port 3260 and not port 7789
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:07:25.550084 IP 192.168.15.1.7777 > 192.168.15.10.52535: P 2547347253:2547347277(24) ack 2784967429 win 2526 <nop,nop,timestamp 5175789 44352636> 15:07:25.550177 IP 192.168.15.10.52535 > 192.168.15.1.7777: . ack 24 win 2729 <nop,nop,timestamp 44353125 5175789> 15:07:25.550187 IP 192.168.15.10.52535 > 192.168.15.1.7777: P 1:25(24) ack 24 win 2729 <nop,nop,timestamp 44353125 5175789> 15:07:25.590004 IP 192.168.15.1.7777 > 192.168.15.10.52535: . ack 25 win 2526 <nop,nop,timestamp 5175799 44353125> 15:07:27.547151 IP 192.168.15.10.52535 > 192.168.15.1.7777: P 25:49(24) ack 24 win 2729 <nop,nop,timestamp 44353625 5175799> 15:07:27.547371 IP 192.168.15.1.7777 > 192.168.15.10.52535: . ack 49 win 2526 <nop,nop,timestamp 5176288 44353625> 15:07:27.547372 IP 192.168.15.1.7777 > 192.168.15.10.52535: P 24:48(24) ack 49 win 2526 <nop,nop,timestamp 5176288 44353625> 15:07:27.587138 IP 192.168.15.10.52535 > 192.168.15.1.7777: . ack 48 win 2729 <nop,nop,timestamp 44353635 5176288> ... 0x0040: 3036 4120 5377 6974 6368 2033 3430 3063 06A.Switch.3400c 0x0050: 6c2d l- 15:07:31.543152 IP 192.168.15.10.52535 > 192.168.15.1.7777: P 73:97(24) ack 72 win 2729 <nop,nop,timestamp 44354624 5176798> 15:07:31.543372 IP 192.168.15.1.7777 > 192.168.15.10.52535: . ack 97 win 2526 <nop,nop,timestamp 5177287 44354624> 15:07:31.543373 IP 192.168.15.1.7777 > 192.168.15.10.52535: P 72:96(24) ack 97 win 2526 <nop,nop,timestamp 5177287 44354624> 15:07:31.583138 IP 192.168.15.10.52535 > 192.168.15.1.7777: . ack 96 win 2729 <nop,nop,timestamp 44354634 5177287> ^C 17 packets captured 17 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n not port 22 and not port 7790 and not port 3260 and not port 7789 and not port 7777
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:07:39.711082 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2f:1b:f9:78, length 576 15:07:43.709910 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2f:1b:f9:78, length 576 15:07:52.851091 arp who-has 192.168.15.10 tell 192.168.15.5 15:07:52.851099 arp reply 192.168.15.10 is-at 00:1b:fc:7d:bb:1e 15:07:57.849975 arp who-has 192.168.15.10 tell 192.168.15.3 15:07:57.849987 arp reply 192.168.15.10 is-at 00:1b:fc:7d:bb:1e 15:07:59.927837 00:15:60:7a:63:a1 > 01:80:c2:00:00:0e, ethertype Unknown (0x88cc), length 180: 0x0000: 0207 0400 1560 7a63 8004 0307 3331 0602 .....`zc....31.. ... 0x0050: 6c2d l- 15:08:39.372686 IP6 fe80::20f:feff:fee6:dd33.5353 > ff02::fb.5353: 0[|domain] 15:08:39.372889 IP 192.168.15.2.5353 > 224.0.0.251.5353: 0 PTR (QM)? _pgpkey-hkp._tcp.local. (40) 15:08:44.370589 arp who-has 192.168.15.10 tell 192.168.15.5 15:08:44.370600 arp reply 192.168.15.10 is-at 00:1b:fc:7d:bb:1e 15:08:56.345714 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2f:1b:f9:78, length 576 ^C 42 packets captured 42 packets received by filter 0 packets dropped by kernel |
#ifconfig eth0.16 up
|
#tcpdump -i eth0 -n not port 22 and not port 7790 and not port 3260 and not port 7789 and not port 7777
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:10:28.828563 arp reply 192.168.16.10 is-at 00:1b:fc:7d:bb:1e 15:10:30.716863 00:15:60:7a:63:a1 > 01:80:c2:00:00:0e, ethertype Unknown (0x88cc), length 180: 0x0000: 0207 0400 1560 7a63 8004 0307 3331 0602 .....`zc....31.. 0x0010: 0078 0802 3331 0a1a 5072 6f43 7572 7665 .x..31..ProCurve 0x0020: 2053 7769 7463 6820 3334 3030 636c 2d34 .Switch.3400cl-4 0x0030: 3847 0c5c 5072 6f43 7572 7665 204a 3439 8G.\ProCurve.J49 0x0040: 3036 4120 5377 6974 6368 2033 3430 3063 06A.Switch.3400c 0x0050: 6c2d l- ... 0x0010: 0078 0802 3331 0a1a 5072 6f43 7572 7665 .x..31..ProCurve 0x0020: 2053 7769 7463 6820 3334 3030 636c 2d34 .Switch.3400cl-4 0x0030: 3847 0c5c 5072 6f43 7572 7665 204a 3439 8G.\ProCurve.J49 0x0040: 3036 4120 5377 6974 6368 2033 3430 3063 06A.Switch.3400c 0x0050: 6c2d l- 15:11:02.014632 00:15:60:7a:63:80 > 09:00:09:00:00:67 Unknown DSAP 0xf8 Unnumbered, ui, Flags [Command], length 99 ^C 13 packets captured 14 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n not port 22 and not port 7790 and not port 3260 and not port 7789 and not port 7777
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:16:39.399393 arp who-has 192.168.15.3 tell 192.168.15.4 15:16:40.399369 arp who-has 192.168.15.3 tell 192.168.15.4 15:16:41.399366 arp who-has 192.168.15.3 tell 192.168.15.4 15:16:44.599917 IP6 fe80::21b:fcff:fe7d:bb37.5353 > ff02::fb.5353: 0 [4q] PTR (QM)? _ftp._tcp.local.[|domain] ^C 4 packets captured 4 packets received by filter 0 packets dropped by kernel |
#ifconfig
br0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.16.10 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::e4f2:76ff:feb3:223a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:66 errors:0 dropped:0 overruns:0 frame:0 TX packets:52 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:5765 (5.6 KiB) TX bytes:7121 (6.9 KiB) eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.15.10 Bcast:192.168.15.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:0 RX bytes:5765 (5.6 KiB) TX bytes:7157 (6.9 KiB) 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:44350 errors:0 dropped:0 overruns:0 frame:0 TX packets:44350 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3882712 (3.7 MiB) TX bytes:3882712 (3.7 MiB) |
#ifconfig | less
|
#ifconfig br0 up
|
#ifconfig eth0.16 up
|
#ifconfig eth1 down
|
#tcpdump -i eth0 -n not port 22 and not port 7790 and not port 3260 and not port 7789 and not port 7777
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:18:07.402118 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:0f:fe:e6:dd:33, length 300 15:18:08.490737 arp who-has 192.168.15.10 tell 192.168.15.4 15:18:08.490760 arp reply 192.168.15.10 is-at 00:1b:fc:7d:bb:1e 15:18:09.250731 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:10.250725 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:11.250715 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:12.354704 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:13.354704 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:14.354697 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:15.458684 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:16.168745 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2f:1b:f9:78, length 576 15:18:16.458681 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:17.458674 arp who-has 192.168.15.3 tell 192.168.15.4 15:18:19.505673 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2f:1b:f9:78, length 576 ^C 14 packets captured 14 packets received by filter 0 packets dropped by kernel |
#iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#lsmod | less
|
#rmmod iptable_nat
|
#modprobe -r nf_nat
|
#lsmod | less
|
#ifconfig tap0
tap0: error fetching interface information: Device not found |
#ifconfig
br0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.16.10 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::e4f2:76ff:feb3:223a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:70 errors:0 dropped:0 overruns:0 frame:0 TX packets:55 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:6027 (5.8 KiB) TX bytes:7247 (7.0 KiB) eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.15.10 Bcast:192.168.15.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:0 RX bytes:6027 (5.8 KiB) TX bytes:7283 (7.1 KiB) 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:44351 errors:0 dropped:0 overruns:0 frame:0 TX packets:44351 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3882952 (3.7 MiB) TX bytes:3882952 (3.7 MiB) |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. From 192.168.16.10 icmp_seq=1 Destination Host Unreachable From 192.168.16.10 icmp_seq=2 Destination Host Unreachable From 192.168.16.10 icmp_seq=3 Destination Host Unreachable ^C --- 192.168.16.1 ping statistics --- 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5026ms , pipe 3 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 br0 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#brctl show
bridge name bridge id STP enabled interfaces br0 8000.001bfc7dbb1e no eth0.16 |
#ping 192.168.16.1
PING 192.168.16.1 (192.168.16.1) 56(84) bytes of data. From 192.168.16.10 icmp_seq=2 Destination Host Unreachable From 192.168.16.10 icmp_seq=3 Destination Host Unreachable From 192.168.16.10 icmp_seq=4 Destination Host Unreachable From 192.168.16.10 icmp_seq=6 Destination Host Unreachable From 192.168.16.10 icmp_seq=7 Destination Host Unreachable From 192.168.16.10 icmp_seq=8 Destination Host Unreachable From 192.168.16.10 icmp_seq=10 Destination Host Unreachable From 192.168.16.10 icmp_seq=11 Destination Host Unreachable From 192.168.16.10 icmp_seq=12 Destination Host Unreachable ... From 192.168.16.10 icmp_seq=70 Destination Host Unreachable From 192.168.16.10 icmp_seq=71 Destination Host Unreachable From 192.168.16.10 icmp_seq=72 Destination Host Unreachable From 192.168.16.10 icmp_seq=74 Destination Host Unreachable From 192.168.16.10 icmp_seq=75 Destination Host Unreachable From 192.168.16.10 icmp_seq=76 Destination Host Unreachable ^C --- 192.168.16.1 ping statistics --- 78 packets transmitted, 0 received, +57 errors, 100% packet loss, time 77075ms , pipe 3 |
#tcpdump -i br0 -m
tcpdump version 3.9.8 libpcap version 0.9.8 Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ] [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ] [ -W filecount ] [ -y datalinktype ] [ -Z user ] [ expression ] |
#tcpdump -i br0 -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on br0, link-type EN10MB (Ethernet), capture size 96 bytes 15:21:55.407643 arp who-has 192.168.16.1 tell 192.168.16.10 15:21:56.407644 arp who-has 192.168.16.1 tell 192.168.16.10 15:21:58.411641 arp who-has 192.168.16.1 tell 192.168.16.10 15:21:59.411641 arp who-has 192.168.16.1 tell 192.168.16.10 ^C 4 packets captured 4 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0.16 -n
tcpdump: WARNING: eth0.16: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0.16, link-type EN10MB (Ethernet), capture size 96 bytes 15:22:14.427643 arp who-has 192.168.16.1 tell 192.168.16.10 15:22:15.427646 arp who-has 192.168.16.1 tell 192.168.16.10 15:22:16.427642 arp who-has 192.168.16.1 tell 192.168.16.10 ^C 3 packets captured 3 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n vlan 16
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes ^C 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth0 -n not port 22
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 15:22:33.879152 IP 192.168.15.10.46326 > 192.168.15.1.3260: P 594182024:594182072(48) ack 451828432 win 216 <nop,nop,timestamp 44580208 5401619> 15:22:33.879368 IP 192.168.15.1.3260 > 192.168.15.10.46326: P 1:49(48) ack 48 win 215 <nop,nop,timestamp 5402869 44580208> 15:22:33.879380 IP 192.168.15.10.46326 > 192.168.15.1.3260: . ack 49 win 216 <nop,nop,timestamp 44580208 5402869> 15:22:34.438524 arp who-has 192.168.15.10 tell 192.168.15.5 15:22:34.438538 arp reply 192.168.15.10 is-at 00:1b:fc:7d:bb:1e 15:22:34.447643 arp who-has 192.168.16.1 tell 192.168.16.10 15:22:34.447856 arp reply 192.168.16.1 is-at 00:0f:fe:7e:b8:53 15:22:34.466710 IP 192.168.15.10.7790 > 192.168.15.1.44600: P 3345144634:3345145178(544) ack 3134325472 win 3072 <nop,nop,timestamp 44580354 5402825> ... 15:22:36.606164 IP 192.168.15.1.7789 > 192.168.15.10.55630: P 80:96(16) ack 49 win 6178 <nop,nop,timestamp 5403550 44580889> 15:22:36.606181 IP 192.168.15.10.55630 > 192.168.15.1.7789: . ack 96 win 24531 <nop,nop,timestamp 44580889 5403550> 15:22:36.767148 IP 192.168.15.10.52535 > 192.168.15.1.7777: P 25:49(24) ack 24 win 2729 <nop,nop,timestamp 44580930 5403092> 15:22:36.767365 IP 192.168.15.1.7777 > 192.168.15.10.52535: . ack 49 win 2526 <nop,nop,timestamp 5403591 44580930> 15:22:36.767366 IP 192.168.15.1.7777 > 192.168.15.10.52535: P 24:48(24) ack 49 win 2526 <nop,nop,timestamp 5403591 44580930> 15:22:36.807139 IP 192.168.15.10.52535 > 192.168.15.1.7777: . ack 48 win 2729 <nop,nop,timestamp 44580940 5403591> ^C 76 packets captured 76 packets received by filter 0 packets dropped by kernel |
#lsmod | grep 802
8021q 16064 0 |
#ifconfig
br0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.16.10 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::e4f2:76ff:feb3:223a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:116 errors:0 dropped:0 overruns:0 frame:0 TX packets:173 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:13065 (12.7 KiB) TX bytes:14508 (14.1 KiB) eth0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.15.10 Bcast:192.168.15.255 Mask:255.255.255.0 ... collisions:0 txqueuelen:1000 RX bytes:381368880 (363.7 MiB) TX bytes:866786011 (826.6 MiB) 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:44522 errors:0 dropped:0 overruns:0 frame:0 TX packets:44522 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3904056 (3.7 MiB) TX bytes:3904056 (3.7 MiB) |
#lsmod
Module Size Used by iptable_filter 2624 0 ip_tables 10160 1 iptable_filter x_tables 13284 1 ip_tables 8021q 16064 0 bridge 40024 0 kvm_intel 31168 0 kvm 108316 1 kvm_intel kqemu 120580 0 ocfs2 381892 2 ... jmicron 2208 0 [permanent] ide_core 96168 3 ide_cd_mod,ide_pci_generic,jmicron uhci_hcd 18672 0 atl1 28392 0 mii 4896 1 atl1 usbcore 118192 4 usbhid,ehci_hcd,uhci_hcd thermal 15228 0 processor 32576 2 acpi_cpufreq,thermal fan 4196 0 thermal_sys 10856 3 thermal,processor,fan |
#brctl delbr
Incorrect number of arguments for command Usage: brctl delbr <bridge> delete bridge |
#brctl delif br0 eth0.16
|
#vconfig delete eth0 16
Unknown command -:delete:- Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig rem eth0.16
Removed VLAN -:eth0.16:- |
#brctl addif br0 eth0.16
|
#ping 192.168.16.2
PING 192.168.16.2 (192.168.16.2) 56(84) bytes of data. ^C --- 192.168.16.2 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#ping 192.168.16.3
PING 192.168.16.3 (192.168.16.3) 56(84) bytes of data. From 192.168.16.10 icmp_seq=1 Destination Host Unreachable From 192.168.16.10 icmp_seq=2 Destination Host Unreachable From 192.168.16.10 icmp_seq=3 Destination Host Unreachable ^C --- 192.168.16.3 ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3007ms , pipe 3 |
#ping 192.168.16.4
PING 192.168.16.4 (192.168.16.4) 56(84) bytes of data. ^C --- 192.168.16.4 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
#ping 192.168.16.254
PING 192.168.16.254 (192.168.16.254) 56(84) bytes of data. From 192.168.16.10 icmp_seq=1 Destination Host Unreachable From 192.168.16.10 icmp_seq=2 Destination Host Unreachable From 192.168.16.10 icmp_seq=3 Destination Host Unreachable ^C --- 192.168.16.254 ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3004ms , pipe 3 |
#brctl show
bridge name bridge id STP enabled interfaces br0 8000.001bfc7dbb1e no eth0.16 |
#ifconfig br0
br0 Link encap:Ethernet HWaddr 00:1b:fc:7d:bb:1e inet addr:192.168.16.10 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::e4f2:76ff:feb3:223a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:116 errors:0 dropped:0 overruns:0 frame:0 TX packets:145 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:13065 (12.7 KiB) TX bytes:11027 (10.7 KiB) |
#ifconfig br0 0.0.0.0
|
#ifconfig br0 192.168.16.10
|
#ping 192.168.16.10
PING 192.168.16.10 (192.168.16.10) 56(84) bytes of data. 64 bytes from 192.168.16.10: icmp_seq=1 ttl=64 time=0.016 ms ^C --- 192.168.16.10 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.016/0.016/0.016/0.000 ms |
#!/bin/sh #sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1 brctl addif br0 $1 ifconfig $1 up
Время первой команды журнала | 11:42:16 2010- 3-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:25:35 2010- 3-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 16.83 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.45 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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