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

Содержание

Журнал

Вторник (04/22/14)

/dev/pts/0
13:56:25
#dpkg -L asterisk-modules | sort | less
13:56:54
#asterisk -rvvvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian2 (pid = 2640)
...
debian2*CLI>
debian2*CLI>
debian2*CLI> co
config   console  core
debian2*CLI> core
No such command 'core ' (type 'core show help core' for other possible commands)
debian2*CLI> core show version
Asterisk 1.8.13.1~dfsg1-3+deb7u3 built by pbuilder @ pungenday on a x86_64 running Linux on 2014-01-04 01:03:48 UTC
debian2*CLI> quit
Executing last minute cleanups
13:59:08
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk.
Starting Asterisk PBX: asterisk.
13:59:54
#/etc/init.d/asterisk stop
Stopping Asterisk PBX: asterisk.
14:00:03
#asterisk -r
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
14:00:13
#ps aux | grep [a]sterisk

14:01:08
#ps aux | grep [a]sterisk

14:01:24
#ls -l /var/run/asterisk/asterisk.ctl
srwxrwx--- 1 asterisk asterisk 0 Апр 22 15:01 /var/run/asterisk/asterisk.ctl
14:01:57
#asterisk -rvvvvvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian2 (pid = 3773)
...
debian2*CLI> core set verbose 999999
Verbosity was 9 and is now 999999
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
debian2*CLI>  asterisk -rx 'core show version'
No such command ' asterisk -rx 'core show version'' (type 'core show help asterisk -rx' for other possible commands)
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
debian2*CLI> quit
Executing last minute cleanups
14:04:40
#asterisk -rx 'core show version'
Asterisk 1.8.13.1~dfsg1-3+deb7u3 built by pbuilder @ pungenday on a x86_64 running Linux on 2014-01-04 01:03:48 UTC
14:04:43
#д3ÐÐдÐl3pwd
/users/Kzn/Asterisk22/debian2/root
прошло 23 минуты
14:28:33
#w
 15:28:37 up 34 min,  2 users,  load average: 0,08, 0,03, 0,05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
user     pts/0    debian2          14:54    5.00s  0.07s  0.02s sshd: user [pri
14:28:37
#ls -l /etc/asterisk/sip.conf
-rw-r----- 1 asterisk asterisk 79163 Янв  4 03:07 /etc/asterisk/sip.conf
14:30:39
#mv /etc/asterisk/sip.conf{,.SAVED}

14:32:25
#ls -l /etc/asterisk/sip.conf.SAVED
-rw-r----- 1 asterisk asterisk 79163 Янв  4 03:07 /etc/asterisk/sip.conf.SAVED
14:32:42
#vim /etc/asterisk/sip.conf
--- /dev/null	2014-04-22 14:54:06.680144806 +0300
+++ /etc/asterisk/sip.conf	2014-04-22 15:54:24.166934900 +0300
@@ -0,0 +1,23 @@
+context=default
+
+; peer
+; 1401 - 1499 все Тренера
+; 1201 - 1299 все мое
+
+
+;[1401]
+;type=friend
+;secret=1234
+;host=dynamic
+
+[1201]
+type=friend
+secret=1234
+host=dynamic
+
+[1202]
+type=friend
+secret=1234
+host=dynamic
+
+
прошло 36 минут
15:09:29
#ifconfig
eth0      Link encap:Ethernet  HWaddr 2c:27:d7:46:19:8f
          inet addr:192.168.12.2  Bcast:192.168.12.255  Mask:255.255.255.0
          inet6 addr: fe80::2e27:d7ff:fe46:198f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8597 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1720 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1971880 (1.8 MiB)  TX bytes:273138 (266.7 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:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:240 (240.0 B)  TX bytes:240 (240.0 B)
15:09:34
#asterisk -rv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian2 (pid = 3773)
Verbosity is at least 9999999
debian2*CLI> sip show p
...
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
    -- Registered SIP '1202' at 192.168.12.102:5060
       > Saved useragent "Linphone/3.7.0 (belle-sip/1.3.0)" for peer 1202
debian2*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
1201                       (Unspecified)                            D   N             0        Unmonitored
1202/1202                  192.168.12.102                           D   N             5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 1 offline]
debian2*CLI> quit
Executing last minute cleanups
прошло 12 минут
15:22:00
## Instalim DHCP

15:22:18
##apt-cache search dhcp server

15:22:21
##apt-get install isc-dhcp-server

15:22:25
## dpkg -L isc-dhcp-server | grep /etc/

15:22:36
#ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 2c:27:d7:46:19:8f brd ff:ff:ff:ff:ff:ff
    inet 192.168.12.2/24 brd 192.168.12.255 scope global eth0
    inet6 fe80::2e27:d7ff:fe46:198f/64 scope link
       valid_lft forever preferred_lft forever
15:25:33
##cat /etc/default/isc-dhcp-server

15:26:08
##Ukazivaem interfeis DHCP servera

15:26:41
#cat /etc/default/isc-dhcp-server
cat: /etc/default/isc-dhcp-server: Нет такого файла или каталога
15:26:52
##/etc/init.d/isc-dhcp-server restart

15:28:41
#dpkg -L isc-dhcp-server | grep /etc/
dpkg-query: пакет «isc-dhcp-server» не установлен
Для проверки файлов архивов используйте команду dpkg --info (dpkg-deb --info),
для вывода списка файлов в них — команду dpkg--contents (dpkg-deb --contents).
15:29:13
##/etc/init.d/isc-dhcp-server restart

15:29:43
#ps aux | grep [d]hcp

15:30:40
#ps aux | grep dhcp
root      4249  0.0  0.0   7856   868 pts/1    S+   16:30   0:00 grep dhcp
15:30:48
#ps aux | grep [d]hcp

15:31:01
#ps aux | grep dhcp
root      4267  0.0  0.0   7856   872 pts/1    S+   16:31   0:00 grep dhcp
15:31:17
#ps aux | grep [d]hcp

15:35:14
#ps aux | grep [a]sterisk
asterisk  3773  0.1  0.1 760528 30448 ?        Ssl  15:01   0:06 /usr/sbin/asterisk -p -U asterisk
asterisk  3774  0.0  0.0  13912   768 ?        S    15:01   0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 3773
15:35:29
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian2 (pid = 3773)
...
debian2*CLI> core set verbose
0        0...     1        1...     2        2...     3        3...     4        4...     5        5...
6        6...     7        7...     8        8...     9        9...     off      atleast
debian2*CLI> core set verbose 999
Verbosity was 9999999 and is now 999
debian2*CLI>
debian2*CLI>
debian2*CLI>
debian2*CLI> quit
Executing last minute cleanups
15:38:43
#iconfig
l3script: iconfig: команда не найдена
15:38:49
#ip
ip                          ipcmk                       ipod-time-sync              iptables-restore
ip6tables                   ipcrm                       ipptool                     iptables-save
ip6tables-apply             ipcs                        iproxy                      iptables-xml
ip6tables-restore           ipmaddr                     iptables                    iptunnel
ip6tables-save              ipod-read-sysinfo-extended  iptables-apply
15:38:49
#ip
.ICE-unix/          pulse-OG4mtcFOfbuR/ pulse-PKdhtXMmr18n/ .X0-lock            .X11-unix/
15:38:49
#ip
.ICE-unix/          pulse-OG4mtcFOfbuR/ pulse-PKdhtXMmr18n/ .X0-lock            .X11-unix/
15:39:11
#asterisk -rvvv
Asterisk 1.8.13.1~dfsg1-3+deb7u3, Copyright (C) 1999 - 2012 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.8.13.1~dfsg1-3+deb7u3 currently running on debian2 (pid = 3773)
...
       Option "load" forces lookup of peer in realtime storage.
debian2*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
1201/1201                  192.168.12.208                           D   N             5060     Unmonitored
1202/1202                  192.168.12.102                           D   N             5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
debian2*CLI> quit
Executing last minute cleanups
прошло 12 минут
15:51:53
#~
Name/username              Host                                    Dyn Forcerport ACL Port     Status
1201/1201                  192.168.12.208                           D   N             5060     Unmonitored
1202/1202                  192.168.12.102                           D   N             5060     Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
прошло 13 минут
16:05:48
#[1202]

16:07:26