/l3/users/2014-11-nt-voip/nt-voip/debian4/root :1 :2 :3 :4 |
|
#layout "us,ru"
ping 192.168.12.254шасщташп ping: unknown host 192.168.12.254шасщташп |
#шifconfig
eth0 Link encap:Ethernet HWaddr 6c:3b:e5:3a:d3:57 inet addr:192.168.12.4 Bcast:192.168.12.255 Mask:255.255.255.0 inet6 addr: fe80::6e3b:e5ff:fe3a:d357/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:19652 errors:0 dropped:4 overruns:0 frame:0 TX packets:9606 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:13675265 (13.0 MiB) TX bytes:959295 (936.8 KiB) Interrupt:18 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:155 errors:0 dropped:0 overruns:0 frame:0 TX packets:155 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:9389 (9.1 KiB) TX bytes:9389 (9.1 KiB) |
#cat/etc/network/interfaces
bash: cat/etc/network/interfaces: No such file or directory |
#cat /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.12.4 netmask 255.255.255.0 gateway 192.168.12.254 |
#screen -x
|
#creen
[root@debian4:~]# |
#creen
[root@debian4:~]# |
#cat /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.12.4 netmask 255.255.255.0 gateway 192.168.12.254 |
#alias exit='echo no exit'
|
#ping 192.168.12.253
PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. 64 bytes from 192.168.12.253: icmp_req=1 ttl=64 time=1.43 ms 64 bytes from 192.168.12.253: icmp_req=2 ttl=64 time=0.662 ms 64 bytes from 192.168.12.253: icmp_req=3 ttl=64 time=0.661 ms 64 bytes from 192.168.12.253: icmp_req=4 ttl=64 time=0.674 ms 64 bytes from 192.168.12.253: icmp_req=5 ttl=64 time=0.669 ms ^C --- 192.168.12.253 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4001ms rtt min/avg/max/mdev = 0.661/0.820/1.436/0.308 ms |
#ping 192.168.12.253
PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. 64 bytes from 192.168.12.253: icmp_req=1 ttl=64 time=1.42 ms 64 bytes from 192.168.12.253: icmp_req=2 ttl=64 time=0.677 ms 64 bytes from 192.168.12.253: icmp_req=3 ttl=64 time=0.669 ms 64 bytes from 192.168.12.253: icmp_req=4 ttl=64 time=0.660 ms 64 bytes from 192.168.12.253: icmp_req=5 ttl=64 time=0.679 ms 64 bytes from 192.168.12.253: icmp_req=6 ttl=64 time=0.742 ms 64 bytes from 192.168.12.253: icmp_req=7 ttl=64 time=0.612 ms 64 bytes from 192.168.12.253: icmp_req=8 ttl=64 time=1.01 ms 64 bytes from 192.168.12.253: icmp_req=9 ttl=64 time=0.677 ms ... 64 bytes from 192.168.12.253: icmp_req=18 ttl=64 time=0.661 ms 64 bytes from 192.168.12.253: icmp_req=19 ttl=64 time=0.661 ms 64 bytes from 192.168.12.253: icmp_req=20 ttl=64 time=0.679 ms 64 bytes from 192.168.12.253: icmp_req=21 ttl=64 time=0.675 ms 64 bytes from 192.168.12.253: icmp_req=22 ttl=64 time=0.660 ms 64 bytes from 192.168.12.253: icmp_req=23 ttl=64 time=0.677 ms ^C --- 192.168.12.253 ping statistics --- 23 packets transmitted, 23 received, 0% packet loss, time 21998ms rtt min/avg/max/mdev = 0.612/0.895/4.790/0.847 ms |
#^C
|
#sed -i s/192.168.12.4/192.168.40.1/ /etc/network/interfaces
|
#cat /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.40.1 netmask 255.255.255.0 gateway 192.168.40.254 |
#cat /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.40.1 netmask 255.255.255.0 gateway 192.168.40.254 |
#cat /etc/network/interfaces
|
#cat /etc/network/interfaces
ping 192.168.12.253 PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. From 192.168.12.4 icmp_seq=1 Destination Host Unreachable From 192.168.12.4 icmp_seq=2 Destination Host Unreachable From 192.168.12.4 icmp_seq=3 Destination Host Unreachable From 192.168.12.4 icmp_seq=4 Destination Host Unreachable From 192.168.12.4 icmp_seq=5 Destination Host Unreachable From 192.168.12.4 icmp_seq=6 Destination Host Unreachable From 192.168.12.4 icmp_seq=7 Destination Host Unreachable From 192.168.12.4 icmp_seq=8 Destination Host Unreachable ... From 192.168.12.4 icmp_seq=19 Destination Host Unreachable From 192.168.12.4 icmp_seq=20 Destination Host Unreachable From 192.168.12.4 icmp_seq=21 Destination Host Unreachable From 192.168.12.4 icmp_seq=22 Destination Host Unreachable From 192.168.12.4 icmp_seq=23 Destination Host Unreachable From 192.168.12.4 icmp_seq=24 Destination Host Unreachable ^C --- 192.168.12.253 ping statistics --- 25 packets transmitted, 0 received, +24 errors, 100% packet loss, time 24118ms pipe 3 |
#ifdown
ifdown: Use --help for help |
#if down
> ^C |
#cat /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.40.1 netmask 255.255.255.0 gateway 192.168.40.254 |
#ifup eth0
|
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 6c:3b:e5:3a:d3:57 inet addr:192.168.40.1 Bcast:192.168.40.255 Mask:255.255.255.0 inet6 addr: fe80::6e3b:e5ff:fe3a:d357/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:94 errors:0 dropped:4 overruns:0 frame:0 TX packets:127 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:12703 (12.4 KiB) TX bytes:14635 (14.2 KiB) Interrupt:18 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.40.254 0.0.0.0 UG 0 0 0 eth0 192.168.40.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
#ping 192.168.12.254
PING 192.168.12.254 (192.168.12.254) 56(84) bytes of data. 64 bytes from 192.168.12.254: icmp_req=1 ttl=63 time=0.309 ms 64 bytes from 192.168.12.254: icmp_req=2 ttl=63 time=0.298 ms 64 bytes from 192.168.12.254: icmp_req=3 ttl=63 time=0.368 ms 64 bytes from 192.168.12.254: icmp_req=4 ttl=63 time=0.363 ms 64 bytes from 192.168.12.254: icmp_req=5 ttl=63 time=0.317 ms 64 bytes from 192.168.12.254: icmp_req=6 ttl=63 time=0.380 ms ^C --- 192.168.12.254 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 4997ms rtt min/avg/max/mdev = 0.298/0.339/0.380/0.033 ms |
#ping 192.168.12.254
PING 192.168.12.254 (192.168.12.254) 56(84) bytes of data. 64 bytes from 192.168.12.254: icmp_req=1 ttl=63 time=0.313 ms 64 bytes from 192.168.12.254: icmp_req=2 ttl=63 time=0.297 ms 64 bytes from 192.168.12.254: icmp_req=3 ttl=63 time=0.303 ms ^C --- 192.168.12.254 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.297/0.304/0.313/0.015 ms |
#ping 192.168.12.253
PING 192.168.12.253 (192.168.12.253) 56(84) bytes of data. 64 bytes from 192.168.12.253: icmp_req=1 ttl=64 time=0.605 ms 64 bytes from 192.168.12.253: icmp_req=2 ttl=64 time=0.675 ms 64 bytes from 192.168.12.253: icmp_req=3 ttl=64 time=0.656 ms ^C --- 192.168.12.253 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.605/0.645/0.675/0.036 ms |
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=53.6 ms 64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=51.3 ms 64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=51.3 ms 64 bytes from 8.8.8.8: icmp_req=4 ttl=48 time=51.4 ms 64 bytes from 8.8.8.8: icmp_req=5 ttl=48 time=51.3 ms 64 bytes from 8.8.8.8: icmp_req=6 ttl=48 time=51.3 ms ^C --- 8.8.8.8 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5007ms rtt min/avg/max/mdev = 51.319/51.742/53.683/0.897 ms |
#apt-get install isc-dhcp-server
Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: isc-dhcp-server-ldap The following NEW packages will be installed: isc-dhcp-server 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 935 kB of archives. After this operation, 2,075 kB of additional disk space will be used. ... Preconfiguring packages ... Selecting previously unselected package isc-dhcp-server. (Reading database ... 128675 files and directories currently installed.) Unpacking isc-dhcp-server (from .../isc-dhcp-server_4.2.2.dfsg.1-5+deb70u6_amd64.deb) ... Processing triggers for man-db ... Setting up isc-dhcp-server (4.2.2.dfsg.1-5+deb70u6) ... 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. |
#dpkg -L isc-dhcp-server | grep /etc
/etc /etc/init.d /etc/init.d/isc-dhcp-server /etc/dhcp /etc/dhcp/dhcpd.conf |
#sed -i s/eht1/eth0/ /etc/default/isc-dhcp-server
|
#grep INTER /etc/default/isc-dhcp-server
INTERFACES="" |
#vim
|
#~
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid). #DHCPD_PID=/var/run/dhcpd.pid "/etc/default/isc-dhcp-server" 21L, 653C # Additional options to start dhcpd with. # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead #OPTIONS="" # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? "eth0" # Separate multiple interfaces with spaces, e.g. "eth0 eth1". ~ ~ ~ "/etc/default/isc-dhcp-server" 21L, 657C written |
## теперь ок
|
#vim /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-4864.29691.28556 2014-11-24 14:56:40.995806354 +0200 +++ /etc/dhcp/dhcpd.conf 2014-11-24 15:23:08.599825237 +0200 @@ -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.40.254; default-lease-time 600; max-lease-time 7200; @@ -32,10 +32,10 @@ # This is a very basic subnet declaration. -#subnet 10.254.239.0 netmask 255.255.255.224 { -# range 10.254.239.10 10.254.239.20; -# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; -#} +subnet 192.168.40.0 netmask 255.255.255.0 { + range 192.168.40.100 192.168.40.200; + option routers 192.168.40.254; +} # This declaration allows BOOTP clients to get dynamic addresses, # which we don't really recommend. |
#creen
|
#layout "us,ru"
allow-hotplug eth0 iface eth0 inet static ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Entering Ex mode. Type "visual" to go to Normal mode. :qz E492: Not an editor command: qz :exit |
#layout "us,ru"
allow-hotplug eth0 iface eth0 inet static ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Entering Ex mode. Type "visual" to go to Normal mode. :qz E492: Not an editor command: qz :exit |
#creen
# to which a BOOTP client is connected which has the dynamic-bootp flag # set. #host fantasia { # hardware ethernet 08:00:07:26:c0:a5; # fixed-address fantasia.fugue.com; #} # You can declare a class of clients and then do address allocation # based on that. The example below shows a case where all clients # in a certain class get addresses on the 10.17.224/24 subnet, and all # other clients get addresses on the 10.0.29/24 subnet. ... # option routers rtr-239-32-1.example.org; #} # A slightly different configuration for an internal subnet. #subnet 10.5.5.0 netmask 255.255.255.224 { # range 10.5.5.26 10.5.5.30; # option domain-name-servers ns1.internal.example.org; # option domain-name "internal.example.org"; # option routers 10.5.5.1; # option broadcast-address 10.5.5.31; recording 55,1 36% |
#creen
#subnet 10.152.187.0 netmask 255.255.255.0 { #} # This is a very basic subnet declaration. #subnet 10.254.239.0 netmask 255.255.255.224 { # range 10.254.239.10 10.254.239.20; # option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; #} # This declaration allows BOOTP clients to get dynamic addresses, 40,1 18% #} ... # option routers rtr-239-32-1.example.org; #} # A slightly different configuration for an internal subnet. #subnet 10.5.5.0 netmask 255.255.255.224 { # range 10.5.5.26 10.5.5.30; # option domain-name-servers ns1.internal.example.org; # option domain-name "internal.example.org"; # option routers 10.5.5.1; # option broadcast-address 10.5.5.31; recording 55,1 36% |
#vim /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-3916.21251.4615 2014-11-24 15:14:29.651831402 +0200 +++ /etc/dhcp/dhcpd.conf 2014-11-24 15:23:08.599825237 +0200 @@ -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.40.254; default-lease-time 600; max-lease-time 7200; @@ -32,10 +32,10 @@ # This is a very basic subnet declaration. -#subnet 10.254.239.0 netmask 255.255.255.224 { -# range 10.254.239.10 10.254.239.20; -# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; -#} +subnet 192.168.40.0 netmask 255.255.255.0 { + range 192.168.40.100 192.168.40.200; + option routers 192.168.40.254; +} # This declaration allows BOOTP clients to get dynamic addresses, # which we don't really recommend. |
#/etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed! Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed! failed! |
#vim /etc/dhcp/dhcpd.conf
--- /tmp/l3-saved-6446.20815.9531 2014-11-24 15:21:51.579825997 +0200 +++ /etc/dhcp/dhcpd.conf 2014-11-24 15:23:08.599825237 +0200 @@ -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.40.254; default-lease-time 600; max-lease-time 7200; @@ -32,10 +32,10 @@ # This is a very basic subnet declaration. -#subnet 10.254.239.0 netmask 255.255.255.224 { -# range 10.254.239.10 10.254.239.20; -# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; -#} +subnet 192.168.40.0 netmask 255.255.255.0 { + range 192.168.40.100 192.168.40.200; + option routers 192.168.40.254; +} # This declaration allows BOOTP clients to get dynamic addresses, # which we don't really recommend. |
#/etc/init.d/isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed! Starting ISC DHCP server: dhcpd. |
#ps aux | grep [d]hcp
root 6192 0.0 0.0 31404 2864 pts/5 S+ 14:56 0:00 /usr/bin/vim /etc/dhcp/dhcpd.conf root 6330 0.0 0.0 31412 2924 pts/3 S+ 15:14 0:00 /usr/bin/vim /etc/dhcp/dhcpd.conf root 6587 0.0 0.0 13024 5620 ? Ss 15:23 0:00 /usr/sbin/dhcpd -q -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid eth0 |
#kill 6192 6330
|
#ps aux | grep [d]hcp
root 6587 0.0 0.0 13024 5620 ? Ss 15:23 0:00 /usr/sbin/dhcpd -q -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid eth0 |
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=54.6 ms 64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=53.7 ms 64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=51.8 ms 64 bytes from 8.8.8.8: icmp_req=4 ttl=48 time=53.1 ms 64 bytes from 8.8.8.8: icmp_req=5 ttl=48 time=52.3 ms 64 bytes from 8.8.8.8: icmp_req=6 ttl=48 time=51.6 ms 64 bytes from 8.8.8.8: icmp_req=7 ttl=48 time=51.5 ms 64 bytes from 8.8.8.8: icmp_req=8 ttl=48 time=54.1 ms 64 bytes from 8.8.8.8: icmp_req=9 ttl=48 time=52.2 ms ... 64 bytes from 8.8.8.8: icmp_req=42 ttl=48 time=51.6 ms 64 bytes from 8.8.8.8: icmp_req=43 ttl=48 time=56.3 ms 64 bytes from 8.8.8.8: icmp_req=44 ttl=48 time=53.7 ms 64 bytes from 8.8.8.8: icmp_req=45 ttl=48 time=51.7 ms 64 bytes from 8.8.8.8: icmp_req=46 ttl=48 time=53.4 ms 64 bytes from 8.8.8.8: icmp_req=47 ttl=48 time=51.7 ms ^C --- 8.8.8.8 ping statistics --- 47 packets transmitted, 47 received, 0% packet loss, time 46043ms rtt min/avg/max/mdev = 51.479/52.882/56.596/1.474 ms |
#ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=54.6 ms 64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=53.7 ms 64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=51.8 ms 64 bytes from 8.8.8.8: icmp_req=4 ttl=48 time=53.1 ms 64 bytes from 8.8.8.8: icmp_req=5 ttl=48 time=52.3 ms 64 bytes from 8.8.8.8: icmp_req=6 ttl=48 time=51.6 ms 64 bytes from 8.8.8.8: icmp_req=7 ttl=48 time=51.5 ms 64 bytes from 8.8.8.8: icmp_req=8 ttl=48 time=54.1 ms 64 bytes from 8.8.8.8: icmp_req=9 ttl=48 time=52.2 ms ... 64 bytes from 8.8.8.8: icmp_req=42 ttl=48 time=51.6 ms 64 bytes from 8.8.8.8: icmp_req=43 ttl=48 time=56.3 ms 64 bytes from 8.8.8.8: icmp_req=44 ttl=48 time=53.7 ms 64 bytes from 8.8.8.8: icmp_req=45 ttl=48 time=51.7 ms 64 bytes from 8.8.8.8: icmp_req=46 ttl=48 time=53.4 ms 64 bytes from 8.8.8.8: icmp_req=47 ttl=48 time=51.7 ms ^C --- 8.8.8.8 ping statistics --- 47 packets transmitted, 47 received, 0% packet loss, time 46043ms rtt min/avg/max/mdev = 51.479/52.882/56.596/1.474 ms |
#apt-get install asterisk
Unpacking freetds-common (from .../freetds-common_0.91-2+deb7u1_all.deb) ... Selecting previously unselected package libsybdb5:amd64. Unpacking libsybdb5:amd64 (from .../libsybdb5_0.91-2+deb7u1_amd64.deb) ... Selecting previously unselected package asterisk-config. Unpacking asterisk-config (from .../asterisk-config_1%3a1.8.13.1~dfsg1-3+deb7u3_all.deb) ... Selecting previously unselected package libiksemel3. Unpacking libiksemel3 (from .../libiksemel3_1.2-4_amd64.deb) ... Selecting previously unselected package libpq5. Unpacking libpq5 (from .../libpq5_9.1.14-0+deb7u1_amd64.deb) ... Selecting previously unselected package libradiusclient-ng2. ... Setting up libmail-sendmail-perl (0.79.16-1) ... Setting up libsox2 (14.4.0-3) ... Setting up libsox-fmt-alsa (14.4.0-3) ... Setting up libsox-fmt-base (14.4.0-3) ... Setting up module-assistant (0.11.4) ... Setting up rsync (3.0.9-4) ... update-rc.d: using dependency based boot sequencing Setting up sox (14.4.0-3) ... Setting up vpb-driver-source (4.2.55-1) ... Setting up asterisk-moh-opsound-gsm (2.03-1) ... |
#apt-get install asterisk
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules asterisk-moh-opsound-gsm asterisk-voicemail autopoint debhelper freetds-common gettext git git-man html2text intltool-debian libcurl3 liberror-perl libgettextpo0 libiksemel3 libmail-sendmail-perl libodbc1 libpq5 libradiusclient-ng2 libresample1 libsaclm3 libsaevt3 libsensors4 libsnmp-base libsnmp15 libsox-fmt-alsa libsox-fmt-base libsox2 ... Setting up libmail-sendmail-perl (0.79.16-1) ... Setting up libsox2 (14.4.0-3) ... Setting up libsox-fmt-alsa (14.4.0-3) ... Setting up libsox-fmt-base (14.4.0-3) ... Setting up module-assistant (0.11.4) ... Setting up rsync (3.0.9-4) ... update-rc.d: using dependency based boot sequencing Setting up sox (14.4.0-3) ... Setting up vpb-driver-source (4.2.55-1) ... Setting up asterisk-moh-opsound-gsm (2.03-1) ... |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#/etc/init.d/asterisk restart
Stopping Asterisk PBX: asterisk. Starting Asterisk PBX: asterisk. |
#ps aux | grep [a]sterisk
asterisk 11635 3.4 0.1 761264 30320 ? Ssl 16:37 0:01 /usr/sbin/asterisk -p -U asterisk asterisk 11636 0.0 0.0 13916 772 ? S 16:37 0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 11635 |
#ps aux | grep [a]sterisk
asterisk 11635 3.4 0.1 761264 30320 ? Ssl 16:37 0:01 /usr/sbin/asterisk -p -U asterisk asterisk 11636 0.0 0.0 13916 772 ? S 16:37 0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 11635 |
#netstat -lnp | grep asterisk
tcp 0 0 127.0.0.1:5038 0.0.0.0:* LISTEN 11635/asterisk tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 11635/asterisk udp 0 0 0.0.0.0:4520 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:4569 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:5000 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:5060 0.0.0.0:* 11635/asterisk unix 2 [ ACC ] STREAM LISTENING 28287 11635/asterisk /var/run/asterisk/asterisk.ctl |
#netstat -lnp | grep asterisk
tcp 0 0 127.0.0.1:5038 0.0.0.0:* LISTEN 11635/asterisk tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 11635/asterisk udp 0 0 0.0.0.0:4520 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:4569 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:5000 0.0.0.0:* 11635/asterisk udp 0 0 0.0.0.0:5060 0.0.0.0:* 11635/asterisk unix 2 [ ACC ] STREAM LISTENING 28287 11635/asterisk /var/run/asterisk/asterisk.ctl |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> debian4*CLI> ... core_event_dispatcher pbx-core core debian4*CLI> sip show channel channels channelstats domains history inuse mwi objects peer peers registry sched settings subscriptions tcp users user debian4*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] debian4*CLI> quit |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> debian4*CLI> ... core_event_dispatcher pbx-core core debian4*CLI> sip show channel channels channelstats domains history inuse mwi objects peer peers registry sched settings subscriptions tcp users user debian4*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] debian4*CLI> quit |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status ... 18014398509481984 (1 << 54) (0x40000000000000) video unknown (unknown) 36028797018963968 (1 << 55) (0x80000000000000) video unknown (unknown) 72057594037927936 (1 << 56) (0x100000000000000) video unknown (unknown) 144115188075855872 (1 << 57) (0x200000000000000) video unknown (unknown) 288230376151711744 (1 << 58) (0x400000000000000) video unknown (unknown) 576460752303423488 (1 << 59) (0x800000000000000) video unknown (unknown) 1152921504606846976 (1 << 60) (0x1000000000000000) video unknown (unknown) 2305843009213693952 (1 << 61) (0x2000000000000000) video unknown (unknown) 4611686018427387904 (1 << 62) (0x4000000000000000) video unknown (unknown) debian4*CLI> quit |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status ... 18014398509481984 (1 << 54) (0x40000000000000) video unknown (unknown) 36028797018963968 (1 << 55) (0x80000000000000) video unknown (unknown) 72057594037927936 (1 << 56) (0x100000000000000) video unknown (unknown) 144115188075855872 (1 << 57) (0x200000000000000) video unknown (unknown) 288230376151711744 (1 << 58) (0x400000000000000) video unknown (unknown) 576460752303423488 (1 << 59) (0x800000000000000) video unknown (unknown) 1152921504606846976 (1 << 60) (0x1000000000000000) video unknown (unknown) 2305843009213693952 (1 << 61) (0x2000000000000000) video unknown (unknown) 4611686018427387904 (1 << 62) (0x4000000000000000) video unknown (unknown) debian4*CLI> quit |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> quit |
#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. ========================================================================= Connected to Asterisk 1.8.13.1~dfsg1-3+deb7u3 currently running on debian4 (pid = 11635) debian4*CLI> quit |
#asterisk -rx `sip show peers`
bash: sip: command not found asterisk: option requires an argument -- 'x' |
#asterisk -rx `sip show peers`
bash: sip: command not found asterisk: option requires an argument -- 'x' |
#asterisk -rx 'sip show peers'
Name/username Host Dyn Forcerport ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] |
#asterisk -rx 'sip show peers'
Name/username Host Dyn Forcerport ACL Port Status 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#etc/init.d/asterisk restart
bash: etc/init.d/asterisk: No such file or directory |
#cat /etc/asterisk/sip.conf
[general] context=default [2101] type=friend secret=1234 host=dynamic [2102] type=friend secret=1234 host=dynamic |
[general] context=default [2101] type=friend secret=1234 host=dynamic [2102] type=friend secret=1234 host=dynamic
auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.40.1 netmask 255.255.255.0 gateway 192.168.40.254
Время первой команды журнала | 09:06:04 2014-11-24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 16:18:53 2014-11-24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 23.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 7.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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