/l3/users/27-07-2009/nt-lnet/debian6.net.nt/root :1 :2 :3 :4 :5 |
|
#ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data. 64 bytes from ya.ru (213.180.204.8): icmp_seq=1 ttl=52 time=56.3 ms --- ya.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 56.362/56.362/56.362/0.000 ms |
#ipcalc
bash: ipcalc: command not found |
#apt-get install ipcalc
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово НОВЫЕ пакеты, которые будут установлены: ipcalc обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 55 пакетов не обновлено. Необходимо скачать 26,4kБ архивов. После распаковки объем занятого дискового пространства возрастёт на 131kB. Получено:1 http://debian.org.ua etch/main ipcalc 0.41-1 [26,4kB] Получено 26,4kB за 0s (417kB/c) Выбор ранее не выбранного пакета ipcalc. (Чтение базы данных... на данный момент установлено 22830 файлов и каталогов.) Распаковывается пакет ipcalc (из файла .../archives/ipcalc_0.41-1_all.deb)... Настраивается пакет ipcalc (0.41-1) ... |
#ipcalc
Usage: ipcalc [options] <ADDRESS>[[/]<NETMASK>] [NETMASK] ipcalc takes an IP address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. -n --nocolor Don't display ANSI color codes. -b --nobinary Suppress the bitwise output. -c --class Just print bit-count-mask of given address. -h --html Display results as HTML (not finished in this version). -v --version Print Version. ... ipcalc 192.168.0.1/24 ipcalc 192.168.0.1/255.255.128.0 ipcalc 192.168.0.1 255.255.128.0 255.255.192.0 ipcalc 192.168.0.1 0.0.63.255 ipcalc <ADDRESS1> - <ADDRESS2> deaggregate address range ipcalc <ADDRESS>/<NETMASK> --s a b c split network to subnets where a b c fits in. ! New HTML support not yet finished. ipcalc 0.41 |
#ipcalc 192.168.54.0/24 /27 | less
|
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:104216 errors:0 dropped:0 overruns:0 frame:0 TX packets:151842 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:24993179 (23.8 MiB) TX bytes:60291788 (57.4 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 BROADCAST MULTICAST MTU:1500 Metric:1 ... RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ipcalc 192.168.54.0/24 /27 | less
|
##
|
##
|
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:105913 errors:0 dropped:0 overruns:0 frame:0 TX packets:153723 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25191560 (24.0 MiB) TX bytes:60564161 (57.7 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 ... RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ping 192.168.54.65
PING 192.168.54.65 (192.168.54.65) 56(84) bytes of data. From 192.168.54.94 icmp_seq=1 Destination Host Unreachable From 192.168.54.94 icmp_seq=2 Destination Host Unreachable From 192.168.54.94 icmp_seq=3 Destination Host Unreachable From 192.168.54.94 icmp_seq=4 Destination Host Unreachable From 192.168.54.94 icmp_seq=5 Destination Host Unreachable From 192.168.54.94 icmp_seq=6 Destination Host Unreachable --- 192.168.54.65 ping statistics --- 7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6013ms , pipe 3 |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:106010 errors:0 dropped:0 overruns:0 frame:0 TX packets:153854 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25199504 (24.0 MiB) TX bytes:60599819 (57.7 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 ... RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:784 (784.0 b) TX bytes:784 (784.0 b) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ifconfig eth2 192.168.54.97
|
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:106277 errors:0 dropped:0 overruns:0 frame:0 TX packets:154135 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25219659 (24.0 MiB) TX bytes:60647968 (57.8 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 ... RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:784 (784.0 b) TX bytes:784 (784.0 b) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ping 192.168.54.65
PING 192.168.54.65 (192.168.54.65) 56(84) bytes of data. From 192.168.54.94 icmp_seq=1 Destination Host Unreachable From 192.168.54.94 icmp_seq=2 Destination Host Unreachable From 192.168.54.94 icmp_seq=3 Destination Host Unreachable --- 192.168.54.65 ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4013ms , pipe 3 |
#ping 192.168.54.65
PING 192.168.54.65 (192.168.54.65) 56(84) bytes of data. From 192.168.54.94 icmp_seq=1 Destination Host Unreachable From 192.168.54.94 icmp_seq=2 Destination Host Unreachable From 192.168.54.94 icmp_seq=3 Destination Host Unreachable From 192.168.54.94 icmp_seq=4 Destination Host Unreachable From 192.168.54.94 icmp_seq=5 Destination Host Unreachable From 192.168.54.94 icmp_seq=6 Destination Host Unreachable From 192.168.54.94 icmp_seq=7 Destination Host Unreachable From 192.168.54.94 icmp_seq=8 Destination Host Unreachable From 192.168.54.94 icmp_seq=9 Destination Host Unreachable From 192.168.54.94 icmp_seq=10 Destination Host Unreachable From 192.168.54.94 icmp_seq=11 Destination Host Unreachable From 192.168.54.94 icmp_seq=12 Destination Host Unreachable --- 192.168.54.65 ping statistics --- 13 packets transmitted, 0 received, +12 errors, 100% packet loss, time 12023ms , pipe 3 |
#ping 192.168.54.65
PING 192.168.54.65 (192.168.54.65) 56(84) bytes of data. 64 bytes from 192.168.54.65: icmp_seq=1 ttl=64 time=0.243 ms 64 bytes from 192.168.54.65: icmp_seq=2 ttl=64 time=0.254 ms 64 bytes from 192.168.54.65: icmp_seq=3 ttl=64 time=0.277 ms 64 bytes from 192.168.54.65: icmp_seq=4 ttl=64 time=0.252 ms 64 bytes from 192.168.54.65: icmp_seq=5 ttl=64 time=0.283 ms --- 192.168.54.65 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3998ms rtt min/avg/max/mdev = 0.243/0.261/0.283/0.025 ms |
#ping 192.168.54.126
From 192.168.54.97 icmp_seq=9 Destination Host Unreachable From 192.168.54.97 icmp_seq=10 Destination Host Unreachable From 192.168.54.97 icmp_seq=11 Destination Host Unreachable From 192.168.54.97 icmp_seq=12 Destination Host Unreachable From 192.168.54.97 icmp_seq=13 Destination Host Unreachable From 192.168.54.97 icmp_seq=14 Destination Host Unreachable From 192.168.54.97 icmp_seq=15 Destination Host Unreachable From 192.168.54.97 icmp_seq=16 Destination Host Unreachable From 192.168.54.97 icmp_seq=17 Destination Host Unreachable From 192.168.54.97 icmp_seq=18 Destination Host Unreachable ... From 192.168.54.97 icmp_seq=151 Destination Host Unreachable From 192.168.54.97 icmp_seq=152 Destination Host Unreachable From 192.168.54.97 icmp_seq=153 Destination Host Unreachable From 192.168.54.97 icmp_seq=154 Destination Host Unreachable From 192.168.54.97 icmp_seq=155 Destination Host Unreachable From 192.168.54.97 icmp_seq=156 Destination Host Unreachable From 192.168.54.97 icmp_seq=157 Destination Host Unreachable --- 192.168.54.126 ping statistics --- 160 packets transmitted, 0 received, +153 errors, 100% packet loss, time 159312ms , pipe 3 |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:106610 errors:0 dropped:0 overruns:0 frame:0 TX packets:154611 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25242823 (24.0 MiB) TX bytes:60754433 (57.9 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 ... RX packets:180 errors:0 dropped:0 overruns:0 frame:0 TX packets:180 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:20160 (19.6 KiB) TX bytes:20160 (19.6 KiB) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ping 192.168.54.65
PING 192.168.54.65 (192.168.54.65) 56(84) bytes of data. 64 bytes from 192.168.54.65: icmp_seq=1 ttl=64 time=0.864 ms 64 bytes from 192.168.54.65: icmp_seq=2 ttl=64 time=0.290 ms 64 bytes from 192.168.54.65: icmp_seq=3 ttl=64 time=0.260 ms --- 192.168.54.65 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2000ms rtt min/avg/max/mdev = 0.260/0.471/0.864/0.278 ms |
#route delete default
From 192.168.54.97 icmp_seq=2 Destination Host Unreachable From 192.168.54.97 icmp_seq=3 Destination Host Unreachable From 192.168.54.97 icmp_seq=4 Destination Host Unreachable From 192.168.54.97 icmp_seq=5 Destination Host Unreachable From 192.168.54.97 icmp_seq=6 Destination Host Unreachable From 192.168.54.97 icmp_seq=7 Destination Host Unreachable From 192.168.54.97 icmp_seq=8 Destination Host Unreachable From 192.168.54.97 icmp_seq=9 Destination Host Unreachable From 192.168.54.97 icmp_seq=10 Destination Host Unreachable From 192.168.54.97 icmp_seq=11 Destination Host Unreachable ... 64 bytes from 192.168.54.126: icmp_seq=141 ttl=64 time=0.396 ms 64 bytes from 192.168.54.126: icmp_seq=142 ttl=64 time=0.454 ms 64 bytes from 192.168.54.126: icmp_seq=143 ttl=64 time=0.449 ms 64 bytes from 192.168.54.126: icmp_seq=144 ttl=64 time=0.405 ms 64 bytes from 192.168.54.126: icmp_seq=145 ttl=64 time=0.420 ms 64 bytes from 192.168.54.126: icmp_seq=146 ttl=64 time=0.479 ms 64 bytes from 192.168.54.126: icmp_seq=147 ttl=64 time=0.367 ms --- 192.168.54.126 ping statistics --- 147 packets transmitted, 17 received, +129 errors, 88% packet loss, time 146270ms rtt min/avg/max/mdev = 0.367/285.490/2496.182/661.833 ms, pipe 3 |
#route add default 192.168.54.65
SIOCADDRT: No such device |
#route add default gw
|
#route print
Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.64 * 255.255.255.224 U 0 0 0 eth1 192.168.54.96 * 255.255.255.224 U 0 0 0 eth2 192.168.16.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#traceroute www.ua
traceroute to nic.net.ua (193.239.250.34), 30 hops max, 40 byte packets 1 * |
#traceroute ya.ru
traceroute: Warning: ya.ru has multiple addresses; using 213.180.204.8 traceroute to ya.ru (213.180.204.8), 30 hops max, 40 byte packets 1 * |
#traceroute www.ua
traceroute to nic.net.ua (193.239.250.34), 30 hops max, 40 byte packets 1 * |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:107893 errors:0 dropped:0 overruns:0 frame:0 TX packets:156158 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25361778 (24.1 MiB) TX bytes:60979326 (58.1 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 ... collisions:0 txqueuelen:1000 RX bytes:8944 (8.7 KiB) TX bytes:15168 (14.8 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:309 errors:0 dropped:0 overruns:0 frame:0 TX packets:309 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:34608 (33.7 KiB) TX bytes:34608 (33.7 KiB) |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#route delete default
|
#route add default 192.168.16.254
SIOCADDRT: No such device |
#route add default gw
|
#apt-get install tcpdump
Чтение списков пакетов... Готово Построение дерева зависимостей... Готово Будут установлены следующие дополнительные пакеты: libpcap0.8 НОВЫЕ пакеты, которые будут установлены: libpcap0.8 tcpdump обновлено 0, установлено 2 новых пакетов, для удаления отмечено 0 пакетов, и 55 пакетов не обновлено. Необходимо скачать 392kБ архивов. После распаковки объем занятого дискового пространства возрастёт на 877kB. Хотите продолжить [Д/н]? Получено:1 http://debian.org.ua etch/main libpcap0.8 0.9.5-1 [89,5kB] Получено:2 http://debian.org.ua etch/main tcpdump 3.9.5-2etch1 [303kB] Получено 392kB за 0s (933kB/c) Выбор ранее не выбранного пакета libpcap0.8. (Чтение базы данных... на данный момент установлено 22844 файлов и каталогов.) Распаковывается пакет libpcap0.8 (из файла .../libpcap0.8_0.9.5-1_i386.deb)... Выбор ранее не выбранного пакета tcpdump. Распаковывается пакет tcpdump (из файла .../tcpdump_3.9.5-2etch1_i386.deb)... Настраивается пакет libpcap0.8 (0.9.5-1) ... Настраивается пакет tcpdump (3.9.5-2etch1) ... |
#route delete default
|
#route add default gw 192.168.54.65
|
#tcpdump -i eth2 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth2 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes 21:11:47.461168 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 172, length 64 21:11:49.262998 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 173, length 64 21:11:51.064797 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 174, length 64 21:11:52.866826 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 175, length 64 21:11:54.668700 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 176, length 64 21:11:56.470606 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 177, length 64 21:11:58.272495 IP 192.168.54.158 > 93.158.134.8: ICMP echo request, id 10765, seq 178, length 64 7 packets captured 7 packets received by filter 0 packets dropped by kernel |
#route add -net 192.168.54.128 netmask 255.255.255.224
|
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#history
30 echo "[a+b]+c+[d+a]" | sed "s/[.*]//" 31 echo "[a+b]+c+[d+a]" | sed "s/[.*]//1" 32 echo "[a+b]+c+[d+a]" | sed s/'[.*]'//1 33 echo "[a+b]+c+[d+a]" | sed s/\[.*\]//1 34 echo "[a+b]+c+[d+a]" | sed 's/\[.*\]//1' 35 echo "[a+b]+c+[d+a]" | sed 's/\[.*\]//' 36 echo "[a+b]+c+[d+a]" | sed 's/\[.*\]//2' 37 echo "[a+b]+c+[d+a]" | sed 's/\[^]]//2' 38 echo "[a+b]+c+[d+a]" | sed 's/\[^]]//1' 39 echo "[a+b]+c+[d+a]" | sed 's/\[[^\]]\]//1' ... 169 netstat -rn 170 ifconfig 171 netstat -rn 172 sysctl net.ipv4.ip_forward=1 173 route add -net 192.168.54.128 gw 192.168.54.126 174 route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.126 175 netstat -rn 176 route -n 177 hist 178 history |
#!148
ifconfig eth1 192.168.54.94 netmask 255.255.255.224 |
#!152
ifconfig eth2 192.168.54.97 netmask 255.255.255.224 |
#!161
route delete default |
#!163
route add default gw 192.168.54.65 |
#!174
route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.126 |
#cat /proc/sys/net/ipv4/ip_forward
0 |
#!172
sysctl net.ipv4.ip_forward=1 net.ipv4.ip_forward = 1 |
#cat /proc/sys/net/ipv4/ip_forward
1 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#tcpdump -i eth1 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 0 packets captured 0 packets received by filter 0 packets dropped by kernel |
#tcpdump -i eth1 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 19:04:08.526746 IP 192.168.16.254 > 213.180.204.8: ICMP echo request, id 2, seq 42, length 64 19:04:08.578931 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 6, length 64 19:04:10.328691 IP 192.168.16.254 > 213.180.204.8: ICMP echo request, id 2, seq 43, length 64 19:04:10.380898 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 7, length 64 19:04:12.130679 IP 192.168.16.254 > 213.180.204.8: ICMP echo request, id 2, seq 44, length 64 19:04:12.182753 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 8, length 64 19:04:13.932573 IP 192.168.16.254 > 213.180.204.8: ICMP echo request, id 2, seq 45, length 64 19:04:13.984608 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 9, length 64 ... 19:04:53.626771 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 31, length 64 19:04:55.428729 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 32, length 64 19:04:57.230628 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 33, length 64 19:04:59.032446 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 34, length 64 19:05:00.834421 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 35, length 64 19:05:02.636382 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 36, length 64 19:05:04.438266 IP 192.168.54.158 > 77.88.21.8: ICMP echo request, id 8208, seq 37, length 64 46 packets captured 46 packets received by filter 0 packets dropped by kernel |
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8199 errors:0 dropped:0 overruns:0 frame:0 TX packets:11120 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:883605 (862.8 KiB) TX bytes:2324931 (2.2 MiB) |
#ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224 inet6 addr: fe80::216:3eff:fe00:106/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:104 errors:0 dropped:0 overruns:0 frame:0 TX packets:243 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7786 (7.6 KiB) TX bytes:15022 (14.6 KiB) |
#ifconfig eth2
eth2 Link encap:Ethernet HWaddr 00:16:3E:00:02:06 inet addr:192.168.54.97 Bcast:192.168.54.127 Mask:255.255.255.224 inet6 addr: fe80::216:3eff:fe00:206/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:149 errors:0 dropped:0 overruns:0 frame:0 TX packets:58 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9106 (8.8 KiB) TX bytes:4432 (4.3 KiB) |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#tcpdump -i eth1 -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 19:05:36.659783 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 0, length 64 19:05:38.460435 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 1, length 64 19:05:40.262316 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 2, length 64 19:05:42.064244 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 3, length 64 19:05:43.866166 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 4, length 64 19:05:45.667934 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 5, length 64 19:05:47.469939 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 6, length 64 19:05:49.271942 IP 192.168.54.158 > 10.0.35.1: ICMP echo request, id 15632, seq 7, length 64 8 packets captured 8 packets received by filter 0 packets dropped by kernel |
#vim /etc/network/interfaces
|
#vim /etc/network/interfaces
|
#vim /etc/sysctl.conf
--- /tmp/l3-saved-1449.1950.7071 2009-07-31 19:50:44.000000000 +0300 +++ /etc/sysctl.conf 2009-07-31 19:52:09.000000000 +0300 @@ -20,7 +20,7 @@ #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 -#net.ipv4.conf.default.forwarding=1 +net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 |
#cat
# # /etc/sysctl.conf - Configuration file for setting system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com #net/ipv4/icmp_echo_ignore_broadcasts=1 # Uncomment the following to stop low-level messages on console #kernel.printk = 4 4 1 7 ##############################################################3 # Functions previously found in netbase # # Uncomment the next line to enable Spoof protection (reverse-path filter) #net.ipv4.conf.default.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 |
#vim /etc/sysctl.conf
--- /tmp/l3-saved-1449.12790.26137 2009-07-31 19:58:26.000000000 +0300 +++ /etc/sysctl.conf 2009-07-31 19:59:54.000000000 +0300 @@ -24,3 +24,4 @@ # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 +net.ipv4.ip_forward=1 |
#cat /etc/sysctl.conf
# # /etc/sysctl.conf - Configuration file for setting system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com #net/ipv4/icmp_echo_ignore_broadcasts=1 # Uncomment the following to stop low-level messages on console #kernel.printk = 4 4 1 7 ##############################################################3 # Functions previously found in netbase # # Uncomment the next line to enable Spoof protection (reverse-path filter) #net.ipv4.conf.default.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 net.ipv4.ip_forward=1 |
#vim /etc/sysctl.conf
--- /tmp/l3-saved-1449.21844.2757 2009-07-31 20:00:02.000000000 +0300 +++ /etc/sysctl.conf 2009-07-31 20:00:15.000000000 +0300 @@ -20,7 +20,7 @@ #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 -net.ipv4.conf.default.forwarding=1 +#net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 |
#cat /etc/sysctl.conf
# # /etc/sysctl.conf - Configuration file for setting system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com #net/ipv4/icmp_echo_ignore_broadcasts=1 # Uncomment the following to stop low-level messages on console #kernel.printk = 4 4 1 7 ##############################################################3 # Functions previously found in netbase # # Uncomment the next line to enable Spoof protection (reverse-path filter) #net.ipv4.conf.default.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 #net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 net.ipv4.ip_forward=1 |
#cat /etc/sysctl.conf
# # /etc/sysctl.conf - Configuration file for setting system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com #net/ipv4/icmp_echo_ignore_broadcasts=1 # Uncomment the following to stop low-level messages on console #kernel.printk = 4 4 1 7 ##############################################################3 # Functions previously found in netbase # # Uncomment the next line to enable Spoof protection (reverse-path filter) #net.ipv4.conf.default.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 #net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 net.ipv4.ip_forward=1 |
#cat
auto lo eth0 eth1 eth2 iface lo inet loopback iface eth0 inet static address 192.168.16.6 netmask 255.255.255.0 # gateway 192.168.16.254 iface eth1 inet static adress 192.168.54.94 netmask 255.255.255.224 iface eth2 inet static adress 192.168.16.97 netmask 255.255.255.224 up route add default gw 192.168.54.65 up route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.126 |
#reboot
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5209 errors:0 dropped:0 overruns:0 frame:0 TX packets:5369 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:577158 (563.6 KiB) TX bytes:1156165 (1.1 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5229 errors:0 dropped:0 overruns:0 frame:0 TX packets:5392 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:578608 (565.0 KiB) TX bytes:1164461 (1.1 MiB) eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06 BROADCAST MULTICAST MTU:1500 Metric:1 ... RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) |
#vim /etc/network/interfaces
--- /tmp/l3-saved-1418.12309.5171 2009-07-31 20:10:51.000000000 +0300 +++ /etc/network/interfaces 2009-07-31 20:12:11.000000000 +0300 @@ -5,10 +5,10 @@ netmask 255.255.255.0 # gateway 192.168.16.254 iface eth1 inet static - adress 192.168.54.94 + address 192.168.54.94 netmask 255.255.255.224 iface eth2 inet static - adress 192.168.16.97 + address 192.168.16.97 netmask 255.255.255.224 up route add default gw 192.168.54.65 up route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.126 |
#/etc/init.d/networking restart
Reconfiguring network interfaces...SIOCADDRT: Network is unreachable Failed to bring up eth2. done. |
#vim /etc/network/interfaces
--- /tmp/l3-saved-1418.8222.8506 2009-07-31 20:12:44.000000000 +0300 +++ /etc/network/interfaces 2009-07-31 20:13:38.000000000 +0300 @@ -8,7 +8,7 @@ address 192.168.54.94 netmask 255.255.255.224 iface eth2 inet static - address 192.168.16.97 + address 192.168.54.97 netmask 255.255.255.224 up route add default gw 192.168.54.65 up route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.126 |
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
#traceroute www.ua
traceroute to nic.net.ua (193.239.250.34), 30 hops max, 40 byte packets 1 192.168.54.65 (192.168.54.65) 0.241 ms 0.188 ms 0.195 ms 2 192.168.54.33 (192.168.54.33) 0.388 ms 0.349 ms 0.329 ms 3 192.168.54.1 (192.168.54.1) 0.663 ms 0.624 ms 0.581 ms 4 debian (192.168.16.254) 0.803 ms 0.772 ms 0.715 ms 5 10.0.35.1 (10.0.35.1) 0.942 ms 0.970 ms 0.923 ms 6 192.168.200.2 (192.168.200.2) 1.340 ms 1.298 ms 1.277 ms 7 192.168.100.1 (192.168.100.1) 2.045 ms 2.003 ms 2.288 ms 8 193.200.68.189 (193.200.68.189) 4.084 ms 3.734 ms 3.953 ms 9 193.200.69.241 (193.200.69.241) 4.725 ms 4.739 ms 4.512 ms 10 mgline-ua-ll-gw.colocall.com (62.149.4.25) 5.816 ms 4.978 ms 5.210 ms 11 gi0-2-301.ua-core.l9.kyiv.tsua.net (89.209.11.13) 6.732 ms 5.695 ms 4.836 ms 12 212.40.58.74 (212.40.58.74) 5.339 ms 5.321 ms 4.914 ms 13 dcs-gw.comstar-ua.net (89.209.10.86) 6.264 ms 7.752 ms 5.602 ms 14 charlie.hostmaster.net.ua (193.239.250.34) 8.138 ms 7.278 ms 8.345 ms |
#ping
PING nic.net.ua (193.239.250.34) 56(84) bytes of data. 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=1 ttl=51 time=6.99 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=2 ttl=51 time=6.73 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=3 ttl=51 time=6.66 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=4 ttl=51 time=6.47 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=5 ttl=51 time=8.27 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=6 ttl=51 time=17.3 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=7 ttl=51 time=6.41 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=8 ttl=51 time=7.25 ms 64 bytes from charlie.hostmaster.net.ua (193.239.250.34): icmp_seq=9 ttl=51 time=6.40 ms --- nic.net.ua ping statistics --- 9 packets transmitted, 9 received, 0% packet loss, time 8001ms rtt min/avg/max/mdev = 6.400/8.064/17.370/3.338 ms |
#ps fax
PID TTY STAT TIME COMMAND 1 ? Ss 0:00 init [2] 2 ? S 0:00 [migration/0] 3 ? SN 0:00 [ksoftirqd/0] 4 ? S< 0:00 [events/0] 5 ? S< 0:00 [khelper] 6 ? S< 0:00 [kthread] 7 ? S< 0:00 \_ [xenwatch] 8 ? S< 0:00 \_ [xenbus] 16 ? S< 0:00 \_ [kblockd/0] ... 1458 ttyp3 Ss 0:00 \_ bash -i 1641 ttyp3 S+ 0:00 \_ ssh user@192.168.16.7 1244 ? Ss 0:00 /usr/sbin/cron 1266 tty1 Ss+ 0:00 /sbin/getty 38400 tty1 1267 tty2 Ss+ 0:00 /sbin/getty 38400 tty2 1268 tty3 Ss+ 0:00 /sbin/getty 38400 tty3 1269 tty4 Ss+ 0:00 /sbin/getty 38400 tty4 1270 tty5 Ss+ 0:00 /sbin/getty 38400 tty5 1271 tty6 Ss+ 0:00 /sbin/getty 38400 tty6 1812 ? Ss 0:00 l3-agent |
#ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 1960 648 ? Ss 20:18 0:00 init [2] root 2 0.0 0.0 0 0 ? S 20:18 0:00 [migration/0] root 3 0.0 0.0 0 0 ? SN 20:18 0:00 [ksoftirqd/0] root 4 0.0 0.0 0 0 ? S< 20:18 0:00 [events/0] root 5 0.0 0.0 0 0 ? S< 20:18 0:00 [khelper] root 6 0.0 0.0 0 0 ? S< 20:18 0:00 [kthread] root 7 0.0 0.0 0 0 ? S< 20:18 0:00 [xenwatch] root 8 0.0 0.0 0 0 ? S< 20:18 0:00 [xenbus] root 16 0.0 0.0 0 0 ? S< 20:18 0:00 [kblockd/0] ... user 1408 0.0 0.0 4504 504 ttyp2 Ss+ 20:19 0:00 script -f -q /home/user/.lilalo//7670181612755815 user 1457 0.0 0.0 4632 424 ttyp2 S+ 20:19 0:00 script -f -q /home/user/.lilalo//7670181612755815 user 1458 0.0 0.4 7008 2752 ttyp3 Ss 20:19 0:00 bash -i user 1641 0.0 0.4 4976 2636 ttyp3 S+ 21:02 0:00 ssh user@192.168.16.7 root 1807 0.0 0.1 5456 1060 ttyp1 S+ 21:46 0:00 su - root 1808 0.0 0.1 4716 680 ttyp1 S+ 21:46 0:00 script -f -q /root/.lilalo//11328177871506510067- root 1812 0.0 1.0 11024 6240 ? Ss 21:46 0:00 l3-agent root 1845 0.0 0.0 4844 472 ttyp1 S+ 21:46 0:00 script -f -q /root/.lilalo//11328177871506510067- root 1846 0.0 0.3 5800 1836 ttyp4 Ss 21:46 0:00 bash -i root 1893 0.0 0.1 5172 988 ttyp4 R+ 22:02 0:00 ps aux |
#ps aux | grep "inet
root 1902 0.0 0.1 4624 744 ttyp4 R+ 22:02 0:00 grep inet |
#ps aux | less
|
#ls /etc/init.d/xinetd
ls: /etc/init.d/xinetd: No such file or directory |
#ps waux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 1960 648 ? Ss 20:18 0:00 init [2] root 2 0.0 0.0 0 0 ? S 20:18 0:00 [migration/0] root 3 0.0 0.0 0 0 ? SN 20:18 0:00 [ksoftirqd/0] root 4 0.0 0.0 0 0 ? S< 20:18 0:00 [events/0] root 5 0.0 0.0 0 0 ? S< 20:18 0:00 [khelper] root 6 0.0 0.0 0 0 ? S< 20:18 0:00 [kthread] root 7 0.0 0.0 0 0 ? S< 20:18 0:00 [xenwatch] root 8 0.0 0.0 0 0 ? S< 20:18 0:00 [xenbus] root 16 0.0 0.0 0 0 ? S< 20:18 0:00 [kblockd/0] ... user 1408 0.0 0.0 4504 504 ttyp2 Ss+ 20:19 0:00 script -f -q /home/user/.lilalo//7670181612755815451-1249060775.scr user 1457 0.0 0.0 4632 424 ttyp2 S+ 20:19 0:00 script -f -q /home/user/.lilalo//7670181612755815451-1249060775.scr user 1458 0.0 0.4 7008 2752 ttyp3 Ss 20:19 0:00 bash -i user 1641 0.0 0.4 4976 2636 ttyp3 S+ 21:02 0:00 ssh user@192.168.16.7 root 1807 0.0 0.1 5456 1060 ttyp1 S+ 21:46 0:00 su - root 1808 0.0 0.1 4716 680 ttyp1 S+ 21:46 0:00 script -f -q /root/.lilalo//11328177871506510067-1249066009.script root 1812 0.0 1.0 11024 6268 ? Ss 21:46 0:00 l3-agent root 1845 0.0 0.0 4844 472 ttyp1 S+ 21:46 0:00 script -f -q /root/.lilalo//11328177871506510067-1249066009.script root 1846 0.0 0.3 5800 1836 ttyp4 Ss 21:46 0:00 bash -i root 1927 0.0 0.1 5172 988 ttyp4 R+ 22:05 0:00 ps waux |
#ps waux | grep inet
root 1936 0.0 0.1 4620 740 ttyp4 R+ 22:05 0:00 grep inet |
#ps waux | grep inetd
root 1945 0.0 0.1 4620 740 ttyp4 R+ 22:05 0:00 grep inetd |
#ls /etc/inetd*
/etc/inetd.conf |
#cat
[root@debian6:~]# ls /etc/inetd.conf /etc/inetd.conf # /etc/inetd.conf: see inetd(8) for further informations. # # Internet superserver configuration database # # # Lines starting with "#:LABEL:" or "#<off>#" should not # be changed unless you know what you are doing! # ... #:STANDARD: These are standard services. #:BSD: Shell, login, exec and talk are BSD protocols. #:MAIL: Mail, news and uucp services. #:INFO: Info services #:BOOT: TFTP service is provided primarily for booting. Most sites # run this only on machines acting as "boot servers." #:RPC: RPC based services #:HAM-RADIO: amateur-radio services #:OTHER: Other services #vnc1 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query 127.0.0.1 -once -geometry 1024x768 -depth 24 |
#wheris inetd
bash: wheris: command not found |
#where
inetd: /usr/sbin/inetd /etc/inetd.conf /usr/share/man/man8/inetd.8.gz |
#whereis x
xinetd: |
#ps
PID TTY TIME CMD 1846 ttyp4 00:00:00 bash 2001 ttyp4 00:00:00 ps |
#ps a
PID TTY STAT TIME COMMAND 1266 tty1 Ss+ 0:00 /sbin/getty 38400 tty1 1267 tty2 Ss+ 0:00 /sbin/getty 38400 tty2 1268 tty3 Ss+ 0:00 /sbin/getty 38400 tty3 1269 tty4 Ss+ 0:00 /sbin/getty 38400 tty4 1270 tty5 Ss+ 0:00 /sbin/getty 38400 tty5 1271 tty6 Ss+ 0:00 /sbin/getty 38400 tty6 1320 ttyp0 Ss+ 0:00 script -f -q /home/user/.lilalo//1366332251561326610-1249060769.script 1369 ttyp0 S+ 0:00 script -f -q /home/user/.lilalo//1366332251561326610-1249060769.script 1370 ttyp1 Ss 0:00 bash -i 1408 ttyp2 Ss+ 0:00 script -f -q /home/user/.lilalo//7670181612755815451-1249060775.script 1457 ttyp2 S+ 0:00 script -f -q /home/user/.lilalo//7670181612755815451-1249060775.script 1458 ttyp3 Ss 0:00 bash -i 1641 ttyp3 S+ 0:00 ssh user@192.168.16.7 1807 ttyp1 S+ 0:00 su - 1808 ttyp1 S+ 0:00 script -f -q /root/.lilalo//11328177871506510067-1249066009.script 1845 ttyp1 S+ 0:00 script -f -q /root/.lilalo//11328177871506510067-1249066009.script 1846 ttyp4 Ss 0:00 bash -i 2009 ttyp4 R+ 0:00 ps a |
# # /etc/sysctl.conf - Configuration file for setting system variables # See sysctl.conf (5) for information. # #kernel.domainname = example.com #net/ipv4/icmp_echo_ignore_broadcasts=1 # Uncomment the following to stop low-level messages on console #kernel.printk = 4 4 1 7 ##############################################################3 # Functions previously found in netbase # # Uncomment the next line to enable Spoof protection (reverse-path filter) #net.ipv4.conf.default.rp_filter=1 # Uncomment the next line to enable TCP/IP SYN cookies #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 #net.ipv4.conf.default.forwarding=1 # Uncomment the next line to enable packet forwarding for IPv6 #net.ipv6.conf.default.forwarding=1 net.ipv4.ip_forward=1
1
[root@debian6:~]# ls /etc/inetd.conf /etc/inetd.conf # /etc/inetd.conf: see inetd(8) for further informations. # # Internet superserver configuration database # # # Lines starting with "#:LABEL:" or "#<off>#" should not # be changed unless you know what you are doing! # # If you want to disable an entry so it isn't touched during # package updates just comment it out with a single '#' character. # # Packages should modify this file by using update-inetd(8) # # <service_name> <sock_type> <proto> <flags> <user> <server_path> <args> # #:INTERNAL: Internal services #discard stream tcp nowait root internal #discard dgram udp wait root internal #daytime stream tcp nowait root internal #time stream tcp nowait root internal #:STANDARD: These are standard services. #:BSD: Shell, login, exec and talk are BSD protocols. #:MAIL: Mail, news and uucp services. #:INFO: Info services #:BOOT: TFTP service is provided primarily for booting. Most sites # run this only on machines acting as "boot servers." #:RPC: RPC based services #:HAM-RADIO: amateur-radio services #:OTHER: Other services #vnc1 stream tcp nowait nobody /usr/bin/Xvnc Xvnc -inetd -query 127.0.0.1 -once -geometry 1024x768 -depth 24
Время первой команды журнала | 19:43:45 2009- 7-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 21:08:54 2009- 7-31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 100 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 9.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 4.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.83 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.59 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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