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

Содержание

Журнал

Вторник (06/02/09)

/dev/pts/12
09:37:21
#cat aaa | uniq | wc -l
22
09:37:31
#ip route
192.168.103.0/24 dev eth0  proto kernel  scope link  src 192.168.103.102
default via 192.168.103.101 dev eth0
09:37:36
#ping 192.168.101.1
PING 192.168.101.1 (192.168.101.1) 56(84) bytes of data.
From 192.168.103.102 icmp_seq=1 Destination Host Unreachable
From 192.168.103.102 icmp_seq=2 Destination Host Unreachable
From 192.168.103.102 icmp_seq=3 Destination Host Unreachable
From 192.168.103.102 icmp_seq=4 Destination Host Unreachable
From 192.168.103.102 icmp_seq=5 Destination Host Unreachable
From 192.168.103.102 icmp_seq=6 Destination Host Unreachable
From 192.168.103.102 icmp_seq=7 Destination Host Unreachable
From 192.168.103.102 icmp_seq=8 Destination Host Unreachable
From 192.168.103.102 icmp_seq=9 Destination Host Unreachable
...
From 192.168.103.102 icmp_seq=24 Destination Host Unreachable
From 192.168.103.102 icmp_seq=27 Destination Host Unreachable
From 192.168.103.102 icmp_seq=28 Destination Host Unreachable
From 192.168.103.102 icmp_seq=29 Destination Host Unreachable
From 192.168.103.102 icmp_seq=30 Destination Host Unreachable
From 192.168.103.102 icmp_seq=33 Destination Host Unreachable
^C
--- 192.168.101.1 ping statistics ---
34 packets transmitted, 0 received, +28 errors, 100% packet loss, time 33173ms
, pipe 3
09:38:41
#ping 192.168.103.1
PING 192.168.103.1 (192.168.103.1) 56(84) bytes of data.
64 bytes from 192.168.103.1: icmp_seq=1 ttl=64 time=1.81 ms
64 bytes from 192.168.103.1: icmp_seq=2 ttl=64 time=0.115 ms
^C
--- 192.168.103.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.115/0.966/1.817/0.851 ms
09:40:10
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data.
From 192.168.103.102 icmp_seq=3 Destination Host Unreachable
From 192.168.103.102 icmp_seq=4 Destination Host Unreachable
From 192.168.103.102 icmp_seq=7 Destination Host Unreachable
From 192.168.103.102 icmp_seq=8 Destination Host Unreachable
From 192.168.103.102 icmp_seq=9 Destination Host Unreachable
From 192.168.103.102 icmp_seq=10 Destination Host Unreachable
^C
--- 10.0.35.100 ping statistics ---
13 packets transmitted, 0 received, +6 errors, 100% packet loss, time 12049ms
, pipe 3
09:41:25
#help

09:41:25
#vi /etc/network/interfaces
09:43:40
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
192.168.103.0/24 dev eth0  proto kernel  scope link  src 192.168.103.102
default via 192.168.103.101 dev eth0
09:44:12
#help
                     fconfig eth0 192.168.103.2 netmask 255.255.255.0
09:45:25
#ping 10.0.35.100
connect: Network is unreachable
09:46:00
#ip route default via 192.168.103.1
Command "default" is unknown, try "ip route help".
09:46:26
#ip route add gw 192.168.103.2
Error: an inet prefix is expected rather than "gw".
09:46:57
#ip route help
Usage: ip route { list | flush } SELECTOR
       ip route get ADDRESS [ from ADDRESS iif STRING ]
                            [ oif STRING ]  [ tos TOS ]
       ip route { add | del | change | append | replace | monitor } ROUTE
SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ]
            [ table TABLE_ID ] [ proto RTPROTO ]
            [ type TYPE ] [ scope SCOPE ]
ROUTE := NODE_SPEC [ INFO_SPEC ]
NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ]
             [ table TABLE_ID ] [ proto RTPROTO ]
...
           [ rto_min TIME ]
TYPE := [ unicast | local | broadcast | multicast | throw |
          unreachable | prohibit | blackhole | nat ]
TABLE_ID := [ local | main | default | all | NUMBER ]
SCOPE := [ host | link | global | NUMBER ]
FLAGS := [ equalize ]
MP_ALGO := { rr | drr | random | wrandom }
NHFLAGS := [ onlink | pervasive ]
RTPROTO := [ kernel | boot | static | NUMBER ]
TIME := NUMBER[s|ms|us|ns|j]
09:48:48
#init 6

/dev/pts/9
09:50:20
#~
192.168.103.0/24 dev eth0  proto kernel  scope link  src 192.168.103.2
default via 192.168.103.1 dev eth0
09:50:24
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data.
64 bytes from 10.0.35.100: icmp_seq=1 ttl=61 time=0.518 ms
64 bytes from 10.0.35.100: icmp_seq=2 ttl=61 time=0.508 ms
64 bytes from 10.0.35.100: icmp_seq=3 ttl=61 time=0.509 ms
^C
--- 10.0.35.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.508/0.511/0.518/0.026 ms
09:50:40
#vconfig
Expecting argc to be 3-5, inclusive.  Was: 1
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.
/dev/pts/12
09:53:09
#ls
Desktop    Download         lv-table  pas       Public     Videos
Documents  e1000e-0.5.18.3  Music     Pictures  Templates  work
/dev/pts/9
09:58:13
#ping 192.168.104.1
PING 192.168.104.1 (192.168.104.1) 56(84) bytes of data.
From 192.168.15.254 icmp_seq=1 Time to live exceeded
From 192.168.15.254 icmp_seq=2 Time to live exceeded
From 192.168.15.254 icmp_seq=3 Time to live exceeded
From 192.168.15.254 icmp_seq=4 Time to live exceeded
From 192.168.15.254 icmp_seq=5 Time to live exceeded
^C
--- 192.168.104.1 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4007ms
09:58:52
#ping 192.168.104.2
PING 192.168.104.2 (192.168.104.2) 56(84) bytes of data.
From 192.168.15.254 icmp_seq=1 Time to live exceeded
From 192.168.15.254 icmp_seq=2 Time to live exceeded
From 192.168.15.254 icmp_seq=3 Time to live exceeded
From 192.168.15.254 icmp_seq=4 Time to live exceeded
From 192.168.15.254 icmp_seq=5 Time to live exceeded
From 192.168.15.254 icmp_seq=6 Time to live exceeded
^C
--- 192.168.104.2 ping statistics ---
6 packets transmitted, 0 received, +6 errors, 100% packet loss, time 5005ms
09:59:01
#ping 192.168.105.2
PING 192.168.105.2 (192.168.105.2) 56(84) bytes of data.
64 bytes from 192.168.105.2: icmp_seq=1 ttl=61 time=1.61 ms
64 bytes from 192.168.105.2: icmp_seq=2 ttl=61 time=1.31 ms
64 bytes from 192.168.105.2: icmp_seq=3 ttl=61 time=1.36 ms
64 bytes from 192.168.105.2: icmp_seq=4 ttl=61 time=1.31 ms
64 bytes from 192.168.105.2: icmp_seq=5 ttl=61 time=1.30 ms
^C
--- 192.168.105.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 1.308/1.384/1.612/0.115 ms
09:59:10
#ssh 10.0.35.100
root@10.0.35.100's password:
Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jun  2 10:17:56 2009 from linux3.unix.nt
l3-agent is already running: pid=1765; pidfile=/root/.lilalo/l3-agent.pid
/dev/pts/12
10:01:22
#cd Pictures/cp aaa ccc
bash: cd: Pictures/cp: Нет такого файла или каталога
10:01:41
#ls
Desktop    Download         lv-table  pas       Public     Videos
Documents  e1000e-0.5.18.3  Music     Pictures  Templates  work
10:01:44
#cd Pictures/

10:02:01
#cp aaa ccc
cp: невозможно выполнить stat для `aaa': Нет такого файла или каталога
10:02:08
#aaa > ccc
bash: aaa: команда не найдена
10:02:22
#ccc | tee aaa
bash: ccc: команда не найдена
10:03:06
#ssh root@192.168.103.1
The authenticity of host '192.168.103.1 (192.168.103.1)' can't be established.
RSA key fingerprint is 34:6c:c2:da:38:7c:d7:17:e9:cd:17:8d:e7:cf:f1:a6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.103.1' (RSA) to the list of known hosts.
root@192.168.103.1's password:
Permission denied, please try again.
root@192.168.103.1's password:
Linux linux6 2.6.29-2-686 #1 SMP Sun May 17 17:56:29 UTC 2009 i686
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun  1 10:03:15 2009 from linux7.unix.nt
l3-agent is already running: pid=16896; pidfile=/root/.lilalo/l3-agent.pid
10:09:18
#tcpdump -n host 192.168.103.2
10:10:01.853672 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 29136, win 1002, options [nop,nop,TS val 230777 ecr 22198922], length 0
10:10:01.853761 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 30192:30976, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 784
10:10:01.853807 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 30976:31184, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 208
10:10:01.853851 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 31184:31392, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 208
10:10:01.853871 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 29776, win 1002, options [nop,nop,TS val 230777 ecr 22198922], length 0
10:10:01.853874 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 29984, win 1002, options [nop,nop,TS val 230777 ecr 22198922], length 0
10:10:01.853875 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 30192, win 1002, options [nop,nop,TS val 230777 ecr 22198922], length 0
10:10:01.853950 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 31392:32032, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 640
10:10:01.853996 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 32032:32240, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 208
10:10:01.854041 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 32240:32448, ack 1, win 239, options [nop,nop,TS val 22198922 ecr 230777], length 208
...
10:10:01.861841 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 55696:55904, ack 1, win 239, options [nop,nop,TS val 22198924 ecr 230779], length 208
10:10:01.861896 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 55904:56112, ack 1, win 239, options [nop,nop,TS val 22198924 ecr 230779], length 208
10:10:01.861910 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 55344, win 1002, options [nop,nop,TS val 230779 ecr 22198924], length 0
10:10:01.861976 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 56112:56464, ack 1, win 239, options [nop,nop,TS val 22198924 ecr 230779], length 352
10:10:01.862024 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 56464:56672, ack 1, win 239, options [nop,nop,TS val 22198924 ecr 230779], length 208
10:10:01.862072 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 56672:56880, ack 1, win 239, options [nop,nop,TS val 22198924 ecr 230779], length 208
10:10:01.862116 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 55696, win 1002, options [nop,nop,TS val 230779 ecr 22198924], length 0
10:10:01.862120 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 55904, win 1002, options [nop,nop,TS val 230779 ecr 22198924], length 0
10:10:01.862122 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 56112, win 1002, options [nop,nop,TS val 230779 ecr 22198924], length 0
10:10:01.862124 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 56464, win 1002, options [nop,nop,TS val 230779 ecr 22198924], length 0
10:10:10
#tcpdump -n host 192.168.103.2 not port 22
tcpdump: syntax error
10:10:44
#tcpdump -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
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
10:11:15
#tcpdump -n
10:11:20.421271 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 22288:22496, ack 1, win 239, options [nop,nop,TS val 22218564 ecr 250419], length 208
10:11:20.421311 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 22496:22704, ack 1, win 239, options [nop,nop,TS val 22218564 ecr 250419], length 208
10:11:20.421349 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 21456, win 8572, options [nop,nop,TS val 250419 ecr 22218564], length 0
10:11:20.421352 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 21664, win 8572, options [nop,nop,TS val 250419 ecr 22218564], length 0
10:11:20.421353 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 21872, win 8572, options [nop,nop,TS val 250419 ecr 22218564], length 0
10:11:20.421354 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 22080, win 8572, options [nop,nop,TS val 250419 ecr 22218564], length 0
10:11:20.421356 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 22288, win 8572, options [nop,nop,TS val 250419 ecr 22218564], length 0
10:11:20.421368 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 22704:22912, ack 1, win 239, options [nop,nop,TS val 22218564 ecr 250419], length 208
10:11:20.421408 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 22912:23120, ack 1, win 239, options [nop,nop,TS val 22218564 ecr 250419], length 208
10:11:20.421447 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 23120:23312, ack 1, win 239, options [nop,nop,TS val 22218564 ecr 250419], length 192
...
10:11:20.424223 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 35552, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:20.424256 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 36128:36320, ack 1, win 239, options [nop,nop,TS val 22218565 ecr 250420], length 192
10:11:20.424296 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 36320:36512, ack 1, win 239, options [nop,nop,TS val 22218565 ecr 250420], length 192
10:11:20.424336 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 36512:36720, ack 1, win 239, options [nop,nop,TS val 22218565 ecr 250420], length 208
10:11:20.424376 IP 192.168.103.1.22 > 192.168.103.2.51739: Flags [P.], seq 36720:36928, ack 1, win 239, options [nop,nop,TS val 22218565 ecr 250420], length 208
10:11:20.424421 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 35744, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:20.424423 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 35936, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:20.424424 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 36128, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:20.424424 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 36320, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:20.424425 IP 192.168.103.2.51739 > 192.168.103.1.22: Flags [.], ack 36512, win 8572, options [nop,nop,TS val 250420 ecr 22218565], length 0
10:11:24
#exit
exit
Connection to 192.168.103.1 closed.
10:12:13
#tcpdump -n 192.168.103.1
tcpdump: syntax error
10:13:07
#tcpdump -n host 192.168.103.1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
10:13:20.556286 ARP, Request who-has 192.168.103.1 tell 192.168.103.2, length 28
10:13:20.556388 ARP, Reply 192.168.103.1 is-at 00:1b:fc:7d:b5:a7, length 46
10:13:42.580290 ARP, Request who-has 192.168.103.1 tell 192.168.103.2, length 28
10:13:42.580395 ARP, Reply 192.168.103.1 is-at 00:1b:fc:7d:b5:a7, length 46
10:13:49.352275 ARP, Request who-has 192.168.103.2 tell 192.168.103.1, length 46
10:13:49.352283 ARP, Reply 192.168.103.2 is-at 00:0a:01:d4:d3:5a, length 28
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
10:13:55
#cat /dev/urandom | tr -cd a-zA-Z0-9'\n' | grep ........ | head -1
UE0sIvIySbux6k9VFCeSDJf3Hj2iAMRO46PmWaDcszMuv2Vg5wyD15PwxhkhT0D
/dev/pts/9
10:17:57
#screen -x
/dev/pts/12
10:19:30
#cat /dev/urandom | tr -cd a-zA-Z0-9'\n' | grep ........ | tail -1
^C
10:19:49
#mii-tool
eth0: negotiated 100baseTx-FD, link ok
SIOCGMIIPHY on 'eth1' failed: Invalid argument
10:20:23
#mii-tool --help
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
       -V, --version               display version information
       -v, --verbose               more verbose output
       -R, --reset                 reset MII to poweron state
       -r, --restart               restart autonegotiation
       -w, --watch                 monitor for link status changes
       -l, --log                   with -w, write events to syslog
       -A, --advertise=media,...   advertise only specified media
       -F, --force=media           force specified media technology
media: 1000baseTx-HD, 1000baseTx-FD,
       100baseT4, 100baseTx-FD, 100baseTx-HD,
       10baseT-FD, 10baseT-HD,
       (to advertise both HD and FD) 1000baseTx, 100baseTx, 10baseT
10:20:47
#mii-tool -F 10baseT
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
       -V, --version               display version information
       -v, --verbose               more verbose output
       -R, --reset                 reset MII to poweron state
       -r, --restart               restart autonegotiation
       -w, --watch                 monitor for link status changes
       -l, --log                   with -w, write events to syslog
       -A, --advertise=media,...   advertise only specified media
       -F, --force=media           force specified media technology
media: 1000baseTx-HD, 1000baseTx-FD,
       100baseT4, 100baseTx-FD, 100baseTx-HD,
       10baseT-FD, 10baseT-HD,
       (to advertise both HD and FD) 1000baseTx, 100baseTx, 10baseT
10:22:15
#mii-tool -F 10baseT-HD
SIOCGMIIPHY on 'eth1' failed: Invalid argument
10:22:39
#mii-tool -F 10baseT-FD
SIOCG