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

Содержание

Журнал

Вторник (10/23/12)

/dev/pts/0
08:45:13
#ping 192.168.15.254
connect: Network is unreachable
08:46:05
#ping 192.168.15.254
connect: Network is unreachable
08:46:19
#ping 192.168.60.1
connect: Network is unreachable
08:46:30
#ifdown eth 0
ifdown: interface eth not configured
ifdown: interface 0 not configured
08:46:39
#ifdown eth0
ifdown: interface eth0 not configured
08:46:41
#ifdown eth0
ifdown: interface eth0 not configured
08:47:18
#ifconfig
eth0      Link encap:Ethernet  HWaddr 2c:27:d7:30:42:78
          inet addr:192.168.70.1  Bcast:192.168.70.255  Mask:255.255.255.0
          inet6 addr: fe80::2e27:d7ff:fe30:4278/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5550 (5.4 KiB)  TX bytes:6080 (5.9 KiB)
          Interrupt:20 Memory:fe400000-fe420000
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:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1136 (1.1 KiB)  TX bytes:1136 (1.1 KiB)
08:47:41
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.70.0    *               255.255.255.0   U     0      0        0 eth0
08:47:47
#ping 192.168.15.253
connect: Network is unreachable
08:48:17
#ne
neotoppm          netkit-ftp        network-admin     newgrp
neqn              net-snmp-config   nevow-xmlgettext  newusers
netcat            netstat           newaliases
08:48:17
#init.d
bash: init.d: команда не найдена
08:49:11
#ps -aux
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.3  0.0   2084   704 ?        Ss   09:41   0:01 init [2]
root         2  0.0  0.0      0     0 ?        S    09:41   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    09:41   0:00 [ksoftirqd/0]
root         4 56.2  0.0      0     0 ?        R    09:41   4:26 [kworker/0:0]
root         6  0.0  0.0      0     0 ?        S    09:41   0:00 [migration/0]
root         7  0.0  0.0      0     0 ?        S    09:41   0:00 [watchdog/0]
root         8  0.0  0.0      0     0 ?        S    09:41   0:00 [migration/1]
root        10  0.0  0.0      0     0 ?        S    09:41   0:00 [ksoftirqd/1]
...
user      1972  0.1  0.0  83040 12324 ?        Sl   09:44   0:00 gnome-terminal
user      1973  0.0  0.0   1952   692 ?        S    09:44   0:00 gnome-pty-helpe
user      1974  0.0  0.0   6268  3464 pts/0    Ss   09:44   0:00 bash
root      1990  0.0  0.0   4476  1408 pts/0    S+   09:44   0:00 su root
root      1999  0.0  0.0   3444   748 pts/0    S+   09:44   0:00 script -f -c ba
root      2030  0.0  0.0   3448   424 pts/0    S+   09:44   0:00 script -f -c ba
root      2031  0.0  0.0   4648  1944 pts/1    Ss   09:44   0:00 bash
user      2070  0.0  0.0   6268  3552 pts/2    Ss+  09:45   0:00 bash
root      2086  0.0  0.0      0     0 ?        S    09:45   0:00 [kworker/2:2]
root      2170  0.0  0.0   3924  1072 pts/1    R+   09:49   0:00 ps -aux
08:49:21
#/etc/init.d/n
networking       network-manager  nfs-common
08:49:21
#/etc/init.d/network-manager stop
Stopping network connection manager: NetworkManager.
08:50:01
#ls /etc/rc
rc0.d/    rc1.d/    rc2.d/    rc3.d/    rc4.d/    rc5.d/    rc6.d/    rc.local  rcS.d/
08:50:01
#ls /etc/rc2.d/*network-manager
/etc/rc2.d/S19network-manager
08:52:53
#ifup eth0
SIOCADDRT: No such process
Failed to bring up eth0.
08:54:32
#ifdown eth0
ifdown: interface eth0 not configured
08:54:51
#ifup eth0
SIOCADDRT: No such process
Failed to bring up eth0.
08:54:54
#dm
dmesg      dmidecode  dmsetup
08:54:54
#dm
dmesg      dmidecode  dmsetup
08:54:54
#dmes
bash: dmes: команда не найдена
08:55:13
#dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.39-bpo.2-686-pae (Debian 2.6.39-3~bpo60+1) (norbert@tretkowski.de) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 SMP Thu Aug 4 11:02:22 UTC 2011
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 0000000000092800 (usable)
[    0.000000]  BIOS-e820: 0000000000092800 - 00000000000a0000 (reserved)
[    0.000000]  BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
[    0.000000]  BIOS-e820: 0000000000100000 - 0000000020000000 (usable)
[    0.000000]  BIOS-e820: 0000000020000000 - 0000000020200000 (reserved)
[    0.000000]  BIOS-e820: 0000000020200000 - 0000000040000000 (usable)
...
[   13.286350] Bluetooth: HCI socket layer initialized
[   13.286351] Bluetooth: L2CAP socket layer initialized
[   13.286620] Bluetooth: SCO socket layer initialized
[   13.300199] Bluetooth: RFCOMM TTY layer initialized
[   13.300209] Bluetooth: RFCOMM socket layer initialized
[   13.300211] Bluetooth: RFCOMM ver 1.11
[   13.377599] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   13.377600] Bluetooth: BNEP filters: protocol multicast
[   13.431525] Bridge firewalling registered
[   19.342339] eth0: no IPv6 routers present
08:55:15
#tail -n 10 /
bin/        etc/        lib/        mnt/        root/       srv/        usr/
boot/       home/       lost+found/ opt/        sbin/       sys/        var/
dev/        initrd.img  media/      proc/       selinux/    tmp/        vmlinuz
08:55:15
#tail -n 10 /var/lo
local/ lock/  log/
08:55:15
#tail -n 10 /var/lo
local/ lock/  log/
08:55:15
#tail -n 10 /var/log/
alternatives.log     dmesg                installer/           pm-powersave.log
apt/                 dmesg.0              kern.log             pycentral.log
aptitude             dmesg.1.gz           lastlog              syslog
asterisk/            dmesg.2.gz           lpr.log              syslog.1
auth.log             dpkg.log             mail.err             unattended-upgrades/
boot                 exim4/               mail.info            user.log
btmp                 faillog              mail.log             wtmp
ConsoleKit/          fontconfig.log       mail.warn            Xorg.0.log
daemon.log           fsck/                messages             Xorg.0.log.old
debug                gdm3/                news/
08:55:15
#tail -n 10 /var/log/
alternatives.log     dmesg                installer/           pm-powersave.log
apt/                 dmesg.0              kern.log             pycentral.log
aptitude             dmesg.1.gz           lastlog              syslog
asterisk/            dmesg.2.gz           lpr.log              syslog.1
auth.log             dpkg.log             mail.err             unattended-upgrades/
boot                 exim4/               mail.info            user.log
btmp                 faillog              mail.log             wtmp
ConsoleKit/          fontconfig.log       mail.warn            Xorg.0.log
daemon.log           fsck/                messages             Xorg.0.log.old
debug                gdm3/                news/
08:55:15
#tail -n 10 /var/log/d
daemon.log  debug       dmesg       dmesg.0     dmesg.1.gz  dmesg.2.gz  dpkg.log
08:55:15
#tail -n 10 /var/log/daemon.log
Oct 23 09:41:44 unix7 gdm-simple-greeter[1755]: Gtk-WARNING: /build/buildd-gtk+2.0_2.20.1-2-i386-TNeM25/gtk+2.0-2.20.1/gtk/gtkwidget.c:5628: widget not within a GtkWindow
Oct 23 09:41:48 unix7 modem-manager: (ttyS1) closing serial device...
Oct 23 09:41:48 unix7 modem-manager: (ttyS1) opening serial device...
Oct 23 09:41:55 unix7 modem-manager: (ttyS1) closing serial device...
Oct 23 09:42:16 unix7 gdm-simple-greeter[1755]: WARNING: Failed to send buffer
Oct 23 09:42:25 unix7 AptDaemon: INFO: Initializing daemon
Oct 23 09:47:26 unix7 AptDaemon: INFO: Quiting due to inactivity
Oct 23 09:47:26 unix7 AptDaemon: INFO: Shutdown was requested
Oct 23 09:49:54 unix7 NetworkManager[1478]: <info> caught signal 15, shutting down normally.
Oct 23 09:49:54 unix7 NetworkManager[1478]: <info> exiting (success)
08:56:24
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.70.0    *               255.255.255.0   U     0      0        0 eth0
08:56:59
#add route
.bash_history         .gnome2/              .nautilus/            Загрузки/
.bash_logout          .gnupg/               .profile              Изображения/
.bash_profile         .gstreamer-0.10/      .recently-used.xbel   Музыка/
.bashrc               .gtk-bookmarks        .ssh/                 Общедоступные/
.config/              .gvfs/                .update-notifier/     Рабочий стол/
.dbus/                .ICEauthority         .xsession-errors      Шаблоны/
.fontconfig/          .l3rc                 .xsession-errors.old
.gconf/               .lilalo/              Видео/
.gconfd/              .local/               Документы/
08:56:59
#add route
.bash_history         .gnome2/              .nautilus/            Загрузки/
.bash_logout          .gnupg/               .profile              Изображения/
.bash_profile         .gstreamer-0.10/      .recently-used.xbel   Музыка/
.bashrc               .gtk-bookmarks        .ssh/                 Общедоступные/
.config/              .gvfs/                .update-notifier/     Рабочий стол/
.dbus/                .ICEauthority         .xsession-errors      Шаблоны/
.fontconfig/          .l3rc                 .xsession-errors.old
.gconf/               .lilalo/              Видео/
.gconfd/              .local/               Документы/
08:56:59
#add route 0.0.0.0 gw 192.168.15.254
bash: add: команда не найдена
08:57:37
#route
.bash_history         .gnome2/              .nautilus/            Загрузки/
.bash_logout          .gnupg/               .profile              Изображения/
.bash_profile         .gstreamer-0.10/      .recently-used.xbel   Музыка/
.bashrc               .gtk-bookmarks        .ssh/                 Общедоступные/
.config/              .gvfs/                .update-notifier/     Рабочий стол/
.dbus/                .ICEauthority         .xsession-errors      Шаблоны/
.fontconfig/          .l3rc                 .xsession-errors.old
.gconf/               .lilalo/              Видео/
.gconfd/              .local/               Документы/
08:57:37
#route
.bash_history         .gnome2/              .nautilus/            Загрузки/
.bash_logout          .gnupg/               .profile              Изображения/
.bash_profile         .gstreamer-0.10/      .recently-used.xbel   Музыка/
.bashrc               .gtk-bookmarks        .ssh/                 Общедоступные/
.config/              .gvfs/                .update-notifier/     Рабочий стол/
.dbus/                .ICEauthority         .xsession-errors      Шаблоны/
.fontconfig/          .l3rc                 .xsession-errors.old
.gconf/               .lilalo/              Видео/
.gconfd/              .local/               Документы/
08:57:37
#route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.70.0    *               255.255.255.0   U     0      0        0 eth0
08:57:49
#shutdown -r
Usage:    shutdown [-akrhPHfFnc] [-t sec] time [warning message]
                  -a:      use /etc/shutdown.allow
                  -k:      don't really shutdown, only warn.
                  -r:      reboot after shutdown.
                  -h:      halt after shutdown.
                  -P:      halt action is to turn off power.
                  -H:      halt action is to just halt.
                  -f:      do a 'fast' reboot (skip fsck).
                  -F:      Force fsck on reboot.
                  -n:      do not go through "init" but go down real fast.
                  -c:      cancel a running shutdown.
                  -t secs: delay between warning and kill signal.
                  ** the "time" argument is mandatory! (try "now") **
08:58:04
#shutdown -r now

/dev/pts/0
09:00:18
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.70.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
09:00:31
#cat /etc/n
nanorc         network/       networks       nsswitch.conf
09:00:31
#cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.70.1
        netmask 255.255.255.0
        network 192.168.70.0
        broadcast 192.168.70.255
        gateway 192.168.15.254
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.70.254
        dns-search unix.nt
09:02:02
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.70.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
09:02:13
#ifdown eth0
ifdown: interface eth0 not configured
09:02:35
#ifup eth0

09:02:47
#ping 192.168.60.1
PING 192.168.60.1 (192.168.60.1) 56(84) bytes of data.
64 bytes from 192.168.60.1: icmp_req=1 ttl=63 time=0.725 ms
^C
--- 192.168.60.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.725/0.725/0.725/0.000 ms
09:02:57
#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_req=1 ttl=63 time=0.480 ms
64 bytes from 192.168.15.254: icmp_req=2 ttl=63 time=0.447 ms
^C
--- 192.168.15.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.447/0.463/0.480/0.027 ms
09:03:04
#./etc/bash-completion
bash: ./etc/bash-completion: Нет такого файла или каталога
09:05:03
#apt-get install isc-dhcp-server
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Предлагаемые пакеты:
  isc-dhcp-server-ldap
НОВЫЕ пакеты, которые будут установлены:
  isc-dhcp-server
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 378 kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 889 kB.
...
Предварительная настройка пакетов ...
Выбор ранее не выбранного пакета isc-dhcp-server.
(Чтение базы данных ... на данный момент установлено 116066 файлов и каталогов.)
Распаковывается пакет isc-dhcp-server (из файла .../isc-dhcp-server_4.1.1-P1-15+squeeze8_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет isc-dhcp-server (4.1.1-P1-15+squeeze8) ...
Generating /etc/default/isc-dhcp-server...
Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
 failed!
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
09:05:51
#apt-get install isc-dhcp-server
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Уже установлена самая новая версия isc-dhcp-server.
обновлено 0, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
09:06:08
#nano /etc/dhcp/dhc
09:06:08
#nano /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-2037.23683.8098	2012-10-23 10:07:36.609640119 +0300
+++ /etc/dhcp/dhcpd.conf	2012-10-23 10:15:26.837640321 +0300
@@ -10,8 +10,8 @@
 ddns-update-style none;
 
 # option definitions common to all supported networks...
-option domain-name "example.org";
-option domain-name-servers ns1.example.org, ns2.example.org;
+option domain-name "unix.nt";
+option domain-name-servers 192.168.15.254;
 
 default-lease-time 600;
 max-lease-time 7200;
@@ -27,8 +27,9 @@
 # No service will be given on this subnet, but declaring it helps the 
 # DHCP server to understand the network topology.
 
-#subnet 10.152.187.0 netmask 255.255.255.0 {
-#}
+subnet 192.168.70.0 netmask 255.255.255.0 {
+range 192.168.70.100 192.168.70.120;
+}
 
 # This is a very basic subnet declaration.
 
09:15:44
#/etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd.
Starting ISC DHCP server: dhcpd.
прошло 17 минут
09:33:13
#less /var/lib/dhcp/dhc
09:33:13
#less /var/lib/dhcp/dhcpd.leases
09:37:00
#tail -f /var/lib/dhcp/dhc
dhclient.leases  dhcpd.leases     dhcpd.leases~
09:37:00
#tail -f /var/lib/dhcp/dhc
dhclient.leases  dhcpd.leases     dhcpd.leases~
09:37:00
#tail -f /var/lib/dhcp/dhcpd.leases
lease 192.168.70.100 {
  starts 2 2012/10/23 07:35:22;
  ends 2 2012/10/23 07:45:22;
  cltt 2 2012/10/23 07:35:22;
  binding state active;
  next binding state free;
  hardware ethernet 18:a9:05:d1:28:a7;
  uid "\001\030\251\005\321(\247";
  client-hostname "maks";
}
...
  starts 2 2012/10/23 07:40:21;
  ends 2 2012/10/23 07:50:21;
  cltt 2 2012/10/23 07:40:21;
  binding state active;
  next binding state free;
  hardware ethernet 18:a9:05:d1:28:a7;
  uid "\001\030\251\005\321(\247";
  client-hostname "maks";
}
^C
09:40:48
#ping 192.168.70.101
PING 192.168.70.101 (192.168.70.101) 56(84) bytes of data.
64 bytes from 192.168.70.101: icmp_req=1 ttl=250 time=68.8 ms
64 bytes from 192.168.70.101: icmp_req=2 ttl=250 time=67.4 ms
^C
--- 192.168.70.101 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 67.402/68.130/68.859/0.773 ms
09:40:56
#ping 192.168.70.100
PING 192.168.70.100 (192.168.70.100) 56(84) bytes of data.
^C
--- 192.168.70.100 ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6046ms
09:41:39
#cat /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
[2201]
type=friend
secret=1234
host=dynamic
прошло 16 минут
09:57:58
#asterisk -rvvv
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity was 0 and is now 3
    -- Registered SIP '2201' at 192.168.70.100 port 5060
[Oct 23 11:11:26] NOTICE[1636]: chan_sip.c:21638 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2201
  == Using SIP RTP CoS mark 5
[Oct 23 11:50:43] NOTICE[1636]: chan_sip.c:20320 handle_request_invite: Call from '2201' to extension '8000' rejected because extension not found in context 'default'.
unix7*CLI> exit
Executing last minute cleanups
прошло 54 минуты
10:52:56
#mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.BACKUP

10:55:06
#nano /etc/asterisk//ext
--- /dev/null	2012-10-23 09:59:10.890595505 +0300
+++ /etc/asterisk//extensions.conf	2012-10-23 12:04:47.045643127 +0300
@@ -0,0 +1,3 @@
+[default]
+
+exten =>8000,1,Playback(welcome)
10:55:06
#nano /etc/asterisk//extensions.conf
--- /tmp/l3-saved-2037.20899.15111	2012-10-23 12:14:52.821643385 +0300
+++ /etc/asterisk/sip.conf	2012-10-23 12:15:25.813643399 +0300
@@ -11,3 +11,9 @@
 secret=1234
 host=dynamic
 
+[2202]
+type=friend
+secret=1234
+host=dynamic
+
+
11:04:49
#[default]
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity is at least 3
unix7*CLI> dialplan reload
...
    -- Added extension 's' priority 1 to app_dial_gosub_virtual_context (0xb52e0f10)
    -- Time to scan old dialplan and merge leftovers back into the new: 0.000290 sec
    -- Time to restore hints and swap in new dialplan: 0.000000 sec
    -- Time to delete the old dialplan: 0.000040 sec
    -- Total time merge_contexts_delete: 0.000330 sec
unix7*CLI> asterisk -rv
No such command 'asterisk -rv' (type 'core show help asterisk -rv' for other possible commands)
unix7*CLI> asterisk -rvv
No such command 'asterisk -rvv' (type 'core show help asterisk -rvv' for other possible commands)
unix7*CLI> exit
11:10:42
#asterisk -rvvv
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
...
unix7*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
2201/2201                  192.168.70.101   D   N      5060     Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
  == Using SIP RTP CoS mark 5
    -- Executing [8000@default:1] Playback("SIP/2201-00000002", "welcome") in new stack
    -- <SIP/2201-00000002> Playing 'welcome.gsm' (language 'en')
    -- Auto fallthrough, channel 'SIP/2201-00000002' status is 'UNKNOWN'
unix7*CLI> exit
Executing last minute cleanups
11:12:36
#e
e2freefrag                     eval
e2fsck                         evince
e2image                        evince-previewer
e2label                        evince-thumbnailer
e2undo                         evolution
echo                           evolution-settings
edit                           ex
editor                         exchange-connector-setup-2.30
editres                        exec
egrep                          exicyclog
...
envsubst                       exiqsumm
eog                            exit
epiphany                       exiv2
epiphany-browser               exiwhat
eps2eps                        expand
epsilon-benchmark              expiry
eqn                            export
esac                           expr
espeak                         eyuvtoppm
espeak-synthesis-driver
11:12:36
#nano /etc/asterisk/sip.conf
11:15:25
#[general]

11:15:31
#[general]
astcanary              astman                 astribank_is_starting
asterisk               astribank_allow        astribank_tool
astgenkey              astribank_hexload
11:15:31
#ast
astcanary              astman                 astribank_is_starting
asterisk               astribank_allow        astribank_tool
astgenkey              astribank_hexload
11:15:31
#asterisk -r
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity is at least 3
unix7*CLI> sip reload
...
[Oct 23 12:17:43] NOTICE[1636]: chan_sip.c:21638 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2202
[Oct 23 12:17:43] NOTICE[1636]: chan_sip.c:21638 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 2202
unix7*CLI> sip show pee
peers  peer
unix7*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
2201/2201                  192.168.70.101   D   N      5060     Unmonitored
2202/2202                  192.168.70.100   D   N      5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
unix7*CLI> exit
11:18:33
#/
bin/        etc/        lost+found/ opt/        sbin/       sys/        var/
boot/       home/       media/      proc/       selinux/    tmp/
dev/        lib/        mnt/        root/       srv/        usr/
11:18:33
#nano /etc/e
11:18:33
#nano /etc/e
--- /tmp/l3-saved-2037.8673.16710	2012-10-23 12:19:22.965643501 +0300
+++ /etc/asterisk//extensions.conf	2012-10-23 12:20:14.893643523 +0300
@@ -1,3 +1,5 @@
 [default]
 
 exten =>8000,1,Playback(welcome)
+
+exten => 2201,1,Dial(SIP/2201)
11:18:33
#nano /etc/asterisk/extensions
11:20:16
#[default]
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity is at least 3
unix7*CLI> sip reload
 Reloading SIP
  == Using SIP RTP CoS mark 5
[Oct 23 12:20:42] NOTICE[1636]: chan_sip.c:20320 handle_request_invite: Call from '2202' to extension '2201' rejected because extension not found in context 'default'.
unix7*CLI> exit
11:20:58
#nano /etc/asterisk//extensions.conf
--- /tmp/l3-saved-2037.4470.24814	2012-10-23 12:28:23.405643731 +0300
+++ /etc/asterisk//extensions.conf	2012-10-23 12:29:27.521643759 +0300
@@ -2,4 +2,4 @@
 
 exten =>8000,1,Playback(welcome)
 
-exten => 2201,1,Dial(SIP/2201)
+exten => _22XX,1,Dial(SIP/${EXTEN})
11:21:09
#[default]
as                     aspell-autobuildhash   astman
asciitopgm             aspell-import          astribank_allow
aseqdump               astcanary              astribank_hexload
aseqnet                asterisk               astribank_is_starting
aspell                 astgenkey              astribank_tool
11:21:09
#asterisk -r
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity is at least 3
unix7*CLI> dialplan reload
...
  == Using SIP RTP CoS mark 5
    -- Executing [2201@default:1] Dial("SIP/2202-00000003", "SIP/2201") in new stack
  == Using SIP RTP CoS mark 5
    -- Called 2201
    -- SIP/2201-00000004 is ringing
    -- SIP/2201-00000004 answered SIP/2202-00000003
    -- Native bridging SIP/2202-00000003 and SIP/2201-00000004
    -- Got SIP response 500 "Server Internal Error" back from 192.168.70.100
  == Spawn extension (default, 2201, 1) exited non-zero on 'SIP/2202-00000003'
unix7*CLI> exit
11:28:20
#nano /etc/asterisk//extensions.conf
11:29:28
#[default]
  GNU nano 2.2.4           Файл: /etc/asterisk//extensions.conf                Изменен
[default]
exten =>8000,1,Playback(welcome)
exten => _22XX,1,Dial(SIP/${EXTEN})
                                   [ Прочитано 5 строк ]
^G Помощь^O Записать    ^R ЧитФайл     ^Y ПредCтр     ^K Вырезать    ^C ТекПозиц
^X Выход  ^J Выровнять   ^W ПÐ^V СледCтр     ^U ОтмВырезк   ^T Словарь
прошло 77 минут
12:46:54
#nano /etc/asterisk//extensions.conf
12:47:18
#[default]
bash: sip: команда не найдена
12:47:25
#as
as                     aspell-autobuildhash   astman
asciitopgm             aspell-import          astribank_allow
aseqdump               astcanary              astribank_hexload
aseqnet                asterisk               astribank_is_starting
aspell                 astgenkey              astribank_tool
12:47:25
#asterisk -r
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
Verbosity is at least 3
unix7*CLI> exit
12:47:36
#asterisk -rvvv
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
...
  == Using SIP RTP CoS mark 5
    -- Executing [2202@default:1] Dial("SIP/2201-00000011", "SIP/2202") in new stack
  == Using SIP RTP CoS mark 5
    -- Called 2202
    -- SIP/2202-00000012 is ringing
    -- SIP/2202-00000012 answered SIP/2201-00000011
    -- Native bridging SIP/2201-00000011 and SIP/2202-00000012
  == Spawn extension (default, 2202, 1) exited non-zero on 'SIP/2201-00000011'
unix7*CLI> exit
Executing last minute cleanups
12:53:44
#nano /etc/asterisk//extensions.conf
--- /tmp/l3-saved-2037.2524.29972	2012-10-23 13:53:50.857645925 +0300
+++ /etc/asterisk//extensions.conf	2012-10-23 13:59:58.797646083 +0300
@@ -3,3 +3,12 @@
 exten =>8000,1,Playback(welcome)
 
 exten => _22XX,1,Dial(SIP/${EXTEN})
+
+exten => _81XX,1,Record(/var/tmp/asterisk/message$(EXTEN:2):gsm,1)
+exten => _81XX,n,Playback(/var/tmp/asterisk/message$(EXTEN:2):gsm)
+
+exten => _82XX,1,Playback(/var/tmp/asterisk/message$(EXTEN:2):gsm)
+
+
+
+
13:03:09
#mkdir /var/tmp/asterisk

13:03:30
#chown asterisk:asterisk /var/tmp/asterisk/

13:07:56
#[default]

13:10:35
#nano /etc/asterisk/extensions.conf
13:10:41
#[default]
message04.gsm  message05.gsm  message06.gsm
13:17:54
#[default]

прошло 16 минут
13:34:27
#[general]
astcanary              astman                 astribank_is_starting
asterisk               astribank_allow        astribank_tool
astgenkey              astribank_hexload
13:34:27
#asterisk -rvvv
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
...
3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 1 offline]
    -- Registered SIP 'manchester' at 192.168.60.1 port 5060
unix7*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
2201/2201                  192.168.70.101   D   N      5060     Unmonitored
2202/2202                  192.168.70.100   D   N      5060     Unmonitored
manchester/london          192.168.60.1     D   N      5060     Unmonitored
3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 3 online, 0 offline]
unix7*CLI> exit
Executing last minute cleanups
13:38:44
#nano /etc/asterisk/extensions.conf
--- /tmp/l3-saved-2037.23484.21128	2012-10-23 14:38:50.825647079 +0300
+++ /etc/asterisk/extensions.conf	2012-10-23 14:41:32.745647149 +0300
@@ -9,6 +9,6 @@
 
 exten => _82XX,1,Playback(/var/tmp/asterisk/message${EXTEN:2:})
 
-
+exten => _21XX,1,Dial(SIP/manchester/${EXTEN})
 
 
13:41:37
#[default]
Asterisk 1.6.2.9-2+squeeze8, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Connected to Asterisk 1.6.2.9-2+squeeze8 currently running on unix7 (pid = 1565)
...
    -- SIP/2201-00000027 is ringing
  == Spawn extension (default, 2201, 1) exited non-zero on 'SIP/manchester-00000026'
  == Using SIP RTP CoS mark 5
    -- Executing [2101@default:1] Dial("SIP/2202-00000028", "SIP/manchester/2101") in new stack
  == Using SIP RTP CoS mark 5
    -- Called manchester/2101
    -- SIP/manchester-00000029 is ringing
  == Spawn extension (default, 2101, 1) exited non-zero on 'SIP/2202-00000028'
unix7*CLI> exit
Executing last minute cleanups
прошло 18 минут
13:59:57
#nano /etc/asterisk/sip.conf
--- /tmp/l3-saved-2037.3582.15006	2012-10-23 15:00:03.229647623 +0300
+++ /etc/asterisk/sip.conf	2012-10-23 15:05:54.309647775 +0300
@@ -7,6 +7,7 @@
 srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
 
 register => london:london@192.168.60.1/manchester
+register => london:london@192.168.40.1/poltava
 
 [2201]
 type=friend
@@ -27,3 +28,13 @@
 secret=london
 canreinvite=no
 qualify=yes
+
+[poltava]
+type=friend
+host=dynamic
+username=london
+secret=london
+canreinvite=no
+qualify=yes
+
+
14:06:12
#nano /etc/asterisk/sip.conf
--- /tmp/l3-saved-2037.30706.28147	2012-10-23 15:06:14.133647783 +0300
+++ /etc/asterisk/sip.conf	2012-10-23 15:06:33.193647791 +0300
@@ -7,7 +7,7 @@
 srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
 
 register => london:london@192.168.60.1/manchester
-register => london:london@192.168.40.1/poltava
+register => london:1234@192.168.40.1/poltava
 
 [2201]
 type=friend

Файлы

  • /etc/asterisk/sip.conf
  • /etc/n
  • /etc/network/interfaces
  • /etc/asterisk/sip.conf
    >
    [general]
    context=default                 ; Default context for incoming calls
    allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
    udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
    tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
    tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
    srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
    [2201]
    type=friend
    secret=1234
    host=dynamic
    
    /etc/n
    >
    nanorc         network/       networks       nsswitch.conf
    
    /etc/network/interfaces
    >
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    # The loopback network interface
    auto lo
    iface lo inet loopback
    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
            address 192.168.70.1
            netmask 255.255.255.0
            network 192.168.70.0
            broadcast 192.168.70.255
            gateway 192.168.15.254
            # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 192.168.70.254
            dns-search unix.nt
    

    Статистика

    Время первой команды журнала08:45:13 2012-10-23
    Время последней команды журнала14:06:12 2012-10-23
    Количество командных строк в журнале101
    Процент команд с ненулевым кодом завершения, % 9.90
    Процент синтаксически неверно набранных команд, % 4.95
    Суммарное время работы с терминалом *, час 3.14
    Количество командных строк в единицу времени, команда/мин 0.54
    Частота использования команд
    nano16|===============| 15.84%
    tail10|=========| 9.90%
    [default]9|========| 8.91%
    ping8|=======| 7.92%
    asterisk7|======| 6.93%
    route7|======| 6.93%
    ifdown5|====| 4.95%
    cat3|==| 2.97%
    add3|==| 2.97%
    ifup3|==| 2.97%
    [general]3|==| 2.97%
    apt-get2|=| 1.98%
    ls2|=| 1.98%
    dm2|=| 1.98%
    shutdown2|=| 1.98%
    less2|=| 1.98%
    ifconfig1|| 0.99%
    mkdir1|| 0.99%
    as1|| 0.99%
    dmesg1|| 0.99%
    dmes1|| 0.99%
    mv1|| 0.99%
    ps1|| 0.99%
    init.d1|| 0.99%
    ./etc/bash-completion1|| 0.99%
    chown1|| 0.99%
    e1|| 0.99%
    /etc/init.d/n1|| 0.99%
    /etc/init.d/isc-dhcp-server1|| 0.99%
    ast1|| 0.99%
    /1|| 0.99%
    /etc/init.d/network-manager1|| 0.99%
    ne1|| 0.99%
    ____
    *) Интервалы неактивности длительностью 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$