/l3/users/gabzya/all/tbil.hq.tbih-sb.com.ua/gabzya :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 :19 :20 :21 :22 :23 :24 :25 :26 :27 :28 :29 :30 |
|
$sudo /etc/init.d/pptpd restart
Shutting down pptpd: [ ОК ] Starting pptpd: [ ОК ] Warning: a pptpd restart does not terminate existing connections, so new connections may be assigned the same IP address and cause unexpected results. Use restart-kill to destroy existing connections during a restart. |
$sudo tail -f /var/log/messages
![]() Mar 6 13:19:45 localhost pppd[22382]: pptpd-logwtmp.so ip-down ppp0 Mar 6 13:19:45 localhost pppd[22382]: Modem hangup Mar 6 13:19:45 localhost pppd[22382]: Connection terminated. Mar 6 13:19:45 localhost pppd[22382]: Connect time 1.4 minutes. Mar 6 13:19:45 localhost pppd[22382]: Sent 5002 bytes, received 2878 bytes. Mar 6 13:19:45 localhost pppd[22382]: Exit. Mar 6 13:19:45 localhost pptpd[22381]: CTRL: Client 192.168.1.21 control connection finished Mar 6 13:19:51 localhost bcrelay[22448]: Running as child Mar 6 13:19:52 localhost pptpd[22447]: MGR: Manager process started Mar 6 13:19:52 localhost pptpd[22447]: MGR: Maximum of 11 connections available ... Mar 6 13:19:58 localhost pppd[22455]: Using interface ppp0 Mar 6 13:19:58 localhost pppd[22455]: Connect: ppp0 <--> /dev/pts/7 Mar 6 13:19:58 localhost pptpd[22454]: CTRL: Ignored a SET LINK INFO packet with real ACCMs! Mar 6 13:19:58 localhost pppd[22455]: MPPC/MPPE 128-bit stateless compression enabled Mar 6 13:20:00 localhost pppd[22455]: found interface eth0 for proxy arp Mar 6 13:20:00 localhost pppd[22455]: local IP address 192.168.1.178 Mar 6 13:20:00 localhost pppd[22455]: remote IP address 192.168.1.90 Mar 6 13:20:00 localhost pppd[22455]: pptpd-logwtmp.so ip-up ppp0 gabzya 192.168.1.21 Mar 6 13:20:01 localhost crond(pam_unix)[22467]: session opened for user root by (uid=0) Mar 6 13:20:02 localhost crond(pam_unix)[22467]: session closed for user root |
$ping 192.168.1.90
![]() PING 192.168.1.90 (192.168.1.90) 56(84) bytes of data. --- 192.168.1.90 ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3012ms |
$ping 192.168.1.178
PING 192.168.1.178 (192.168.1.178) 56(84) bytes of data. 64 bytes from 192.168.1.178: icmp_seq=0 ttl=64 time=0.099 ms --- 192.168.1.178 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.099/0.099/0.099/0.000 ms, pipe 2 |
$sudo ifconfig
eth0 Link encap:Ethernet HWaddr 00:13:8F:6D:4B:AB inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:8fff:fe6d:4bab/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:381971 errors:0 dropped:0 overruns:0 frame:0 TX packets:196061 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:124061508 (118.3 MiB) TX bytes:44040032 (41.9 MiB) Interrupt:10 Base address:0x8c00 eth1 Link encap:Ethernet HWaddr 00:0E:2E:32:46:15 ... TX packets:45308 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16897523 (16.1 MiB) TX bytes:16897523 (16.1 MiB) ppp0 Link encap:Point-to-Point Protocol inet addr:192.168.1.178 P-t-P:192.168.1.90 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1400 Metric:1 RX packets:32 errors:0 dropped:0 overruns:0 frame:0 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:2878 (2.8 KiB) TX bytes:924 (924.0 b) |
$sudo tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 13:20:28.375103 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 3058960941:3058960954(13) ack 1101639205 win 65474 <nop,nop,timestamp 2750698 63370331> 13:20:28.375444 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 13 win 16022 <nop,nop,timestamp 63370357 2750698> 13:20:28.421837 IP webil.hq.tbih-sb.com.ua.32807 > tbi.hq.tbih-sb.com.ua.domain: 9480+ [1au] PTR? 78.1.168.192.in-addr.arpa. (54) 13:20:28.422267 IP tbi.hq.tbih-sb.com.ua.domain > webil.hq.tbih-sb.com.ua.32807: 9480* 1/0/1 (91) 13:20:28.429517 IP webil.hq.tbih-sb.com.ua.32807 > tbi.hq.tbih-sb.com.ua.domain: 4740+ [1au] PTR? 11.1.168.192.in-addr.arpa. (54) 13:20:28.429714 IP tbi.hq.tbih-sb.com.ua.domain > webil.hq.tbih-sb.com.ua.32807: 4740* 1/0/1 (89) 13:20:28.484632 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 13:26(13) ack 1 win 65474 <nop,nop,timestamp 2750699 63370357> 13:20:28.485774 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 26 win 16022 <nop,nop,timestamp 63370385 2750699> ... 13:20:28.703673 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 52 win 16022 <nop,nop,timestamp 63370439 2750701> 13:20:28.812689 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 52:65(13) ack 1 win 65474 <nop,nop,timestamp 2750702 63370439> 13:20:28.812977 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 65 win 16022 <nop,nop,timestamp 63370467 2750702> 13:20:28.922062 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 65:78(13) ack 1 win 65474 <nop,nop,timestamp 2750703 63370467> 13:20:28.922312 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 78 win 16022 <nop,nop,timestamp 63370494 2750703> 13:20:29.031428 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 78:91(13) ack 1 win 65474 <nop,nop,timestamp 2750704 63370494> 13:20:29.031690 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 91 win 16022 <nop,nop,timestamp 63370521 2750704> 18 packets captured 18 packets received by filter 0 packets dropped by kernel |
$sudo tcpdump -i ppp0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ppp0, link-type LINUX_SLL (Linux cooked), capture size 96 bytes 13:20:42.250344 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:43.000388 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:43.750410 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:44.531713 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:51.660084 IP p5.hq.tbih-sb.com.ua.netbios-dgm > 255.255.255.255.netbios-dgm: NBT UDP PACKET(138) 13:20:53.375619 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:54.125535 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:54.875508 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:55.656755 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 13:20:56.406886 IP tbi.hq.tbih-sb.com.ua.netbios-ns > 255.255.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 10 packets captured 10 packets received by filter 0 packets dropped by kernel |
$sudo tcpdump -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 13:21:01.188273 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 3058964841:3058964854(13) ack 1101639205 win 65474 <nop,nop,timestamp 2751026 63378533> 13:21:01.191127 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 13 win 16022 <nop,nop,timestamp 63378561 2751026> 13:21:01.216877 IP rudenko.hq.tbih-sb.com.ua.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) 13:21:01.235396 IP webil.hq.tbih-sb.com.ua > gabzya.hq.tbih-sb.com.ua: call 512 seq 34 gre-ppp-payload 13:21:01.241774 IP webil.hq.tbih-sb.com.ua.32807 > tbi.hq.tbih-sb.com.ua.domain: 19463+ [1au] PTR? 255.1.168.192.in-addr.arpa. (55) 13:21:01.242283 IP tbi.hq.tbih-sb.com.ua.domain > webil.hq.tbih-sb.com.ua.32807: 19463 NXDomain* 0/1/1 (145) 13:21:01.244786 IP webil.hq.tbih-sb.com.ua.32807 > tbi.hq.tbih-sb.com.ua.domain: 28123+ [1au] PTR? 46.1.168.192.in-addr.arpa. (54) 13:21:01.245091 IP tbi.hq.tbih-sb.com.ua.domain > webil.hq.tbih-sb.com.ua.32807: 28123* 1/0/1 (93) ... 13:21:01.844617 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 91 win 16022 <nop,nop,timestamp 63378724 2751032> 13:21:01.953874 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 91:104(13) ack 1 win 65474 <nop,nop,timestamp 2751034 63378724> 13:21:01.954139 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 104 win 16022 <nop,nop,timestamp 63378751 2751034> 13:21:02.063171 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 104:117(13) ack 1 win 65474 <nop,nop,timestamp 2751035 63378751> 13:21:02.063438 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 117 win 16022 <nop,nop,timestamp 63378779 2751035> 13:21:02.172739 IP tbi.hq.tbih-sb.com.ua.3389 > webil.hq.tbih-sb.com.ua.45781: P 117:130(13) ack 1 win 65474 <nop,nop,timestamp 2751036 63378779> 13:21:02.172989 IP webil.hq.tbih-sb.com.ua.45781 > tbi.hq.tbih-sb.com.ua.3389: . ack 130 win 16022 <nop,nop,timestamp 63378806 2751036> 29 packets captured 29 packets received by filter 0 packets dropped by kernel |
$sudo tcpdump -i eth0 icmp
![]() Ошибка сегментирования |
$sudo ifconfig
![]() Password: |
$sudo ifconfig
Password: eth0 Link encap:Ethernet HWaddr 00:13:8F:6D:4B:AB inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:8fff:fe6d:4bab/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:393786 errors:0 dropped:0 overruns:0 frame:0 TX packets:207333 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:125053577 (119.2 MiB) TX bytes:44884417 (42.8 MiB) Interrupt:10 Base address:0x8c00 ... TX packets:45567 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16929554 (16.1 MiB) TX bytes:16929554 (16.1 MiB) ppp0 Link encap:Point-to-Point Protocol inet addr:192.168.1.178 P-t-P:192.168.1.90 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1400 Metric:1 RX packets:42 errors:0 dropped:0 overruns:0 frame:0 TX packets:474 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:3539 (3.4 KiB) TX bytes:48293 (47.1 KiB) |
$sudo ifconfig eth1:0 192.168.2.1
|
$sudo vi /etc/sysconfig/network
![]() |
$sudo vi /etc/sysconfig/network-scripts/
![]() |
$sudo vi /etc/sysconfig/network-scripts/ifcfg-external
|
$sudo ifconfig
Password: eth0 Link encap:Ethernet HWaddr 00:13:8F:6D:4B:AB inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:8fff:fe6d:4bab/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:398688 errors:0 dropped:0 overruns:0 frame:0 TX packets:211904 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:125456521 (119.6 MiB) TX bytes:45207380 (43.1 MiB) Interrupt:10 Base address:0x8c00 ... UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:5 Base address:0x6400 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:45648 errors:0 dropped:0 overruns:0 frame:0 TX packets:45648 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16938480 (16.1 MiB) TX bytes:16938480 (16.1 MiB) |
$sudo vi /etc/sysconfig/network-scripts/ifcfg-external
|
$sudo vi /etc/sysconfig/network-scripts/ifcfg-internal
|
$sudo vi /etc/sysconfig/network-scripts/ifcfg-external
|
$ping 192.168.1.1
![]() PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. From 192.168.1.78 icmp_seq=0 Destination Host Unreachable From 192.168.1.78 icmp_seq=1 Destination Host Unreachable From 192.168.1.78 icmp_seq=2 Destination Host Unreachable --- 192.168.1.1 ping statistics --- 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2014ms , pipe 4 |
$ping 192.168.1.1
![]() PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. --- 192.168.1.1 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
$ping 192.168.1.21
![]() PING 192.168.1.21 (192.168.1.21) 56(84) bytes of data. --- 192.168.1.21 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1005ms |
$ping 192.168.1.21
![]() PING 192.168.1.21 (192.168.1.21) 56(84) bytes of data. --- 192.168.1.21 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1012ms |
$ping 192.168.1.21
![]() PING 192.168.1.21 (192.168.1.21) 56(84) bytes of data. --- 192.168.1.21 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1012ms |
$sudo mii-tool
eth0: no link eth1: negotiated 100baseTx-FD, link ok |
$sudo mii-tool
eth0: no link eth1: negotiated 100baseTx-FD, link ok |
$sudo mii-tool
eth0: no link eth1: negotiated 100baseTx-FD, link ok |
$ping 192.168.1.21
![]() PING 192.168.1.21 (192.168.1.21) 56(84) bytes of data. --- 192.168.1.21 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
$ping 192.168.1.78
PING 192.168.1.78 (192.168.1.78) 56(84) bytes of data. 64 bytes from 192.168.1.78: icmp_seq=0 ttl=64 time=0.105 ms 64 bytes from 192.168.1.78: icmp_seq=1 ttl=64 time=0.083 ms --- 192.168.1.78 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1005ms rtt min/avg/max/mdev = 0.083/0.094/0.105/0.011 ms, pipe 2 |
$ping 192.168.1.7
![]() PING 192.168.1.7 (192.168.1.7) 56(84) bytes of data. --- 192.168.1.7 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
$ping 192.168.1.1
![]() PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. --- 192.168.1.1 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms |
$sudo mii-tool
eth0: no link eth1: no link |
$sudo mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok eth1: no link |
$ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=2003 ms 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1004 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=4.32 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.210 ms 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.204 ms --- 192.168.1.1 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4003ms rtt min/avg/max/mdev = 0.204/602.490/2003.365/800.904 ms, pipe 4 |
$sudo mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok eth1: no link |
$sudo mii-tool
eth0: negotiated 100baseTx-FD flow-control, link ok eth1: negotiated 100baseTx-FD, link ok |
$ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.210 ms --- 192.168.1.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.210/0.210/0.210/0.000 ms, pipe 2 |
$ping 192.168.2.2.54
![]() ping: unknown host 192.168.2.2.54 |
$tcsetattr: Interrupted system call
Killed by signal 15. [1]+ Exit 255 ssh 192.168.1.1 |
$ssh 192.168.1.1
14:08:51.756933 192.168.1.1.3022 > 192.168.1.78.56952: P 28272:28464(192) ack 1 win 11392 <nop,nop,timestamp 304232694 64082231> (DF) [tos 0x10] 14:08:51.756996 192.168.1.1.3022 > 192.168.1.78.56952: P 28464:28656(192) ack 1 win 11392 <nop,nop,timestamp 304232694 64082231> (DF) [tos 0x10] 14:08:51.757059 192.168.1.1.3022 > 192.168.1.78.56952: P 28656:28848(192) ack 1 win 11392 <nop,nop,timestamp 304232694 64082231> (DF) [tos 0x10] 14:08:51.757080 192.168.1.78.56952 > 192.168.1.1.3022: . ack 28272 win 5624 <nop,nop,timestamp 64082231 304232694> (DF) [tos 0x10] 14:08:51.757157 192.168.1.1.3022 > 192.168.1.78.56952: P 28848:29040(192) ack 1 win 11392 <nop,nop,timestamp 304232695 64082231> (DF) [tos 0x10] 14:08:51.757219 192.168.1.1.3022 > 192.168.1.78.56952: P 29040:29216(176) ack 1 win 11392 <nop,nop,timestamp 304232695 64082231> (DF) [tos 0x10] 14:08:51.757270 192.168.1.78.56952 > 192.168.1.1.3022: . ack 28848 win 5624 <nop,nop,timestamp 64082231 304232694> (DF) [tos 0x10] 14:08:51.757301 192.168.1.1.3022 > 192.168.1.78.56952: P 29216:29408(192) ack 1 win 11392 <nop,nop,timestamp 304232695 64082231> (DF) [tos 0x10] 14:08:51.757364 192.168.1.1.3022 > 192.168.1.78.56952: P 29408:29600(192) ack 1 win 11392 <nop,nop,timestamp 304232695 64082231> (DF) [tos 0x10] 14:08:51.757427 192.168.1.1.3022 > 192.168.1.78.56952: P 29600:29792(192) ack 1 win 11392 <nop,nop,timestamp 304232695 64082231> (DF) [tos 0x10] ... 14:08:51.780899 192.168.1.78.56952 > 192.168.1.1.3022: . ack 54528 win 8520 <nop,nop,timestamp 64082237 304232697> (DF) [tos 0x10] 14:08:51.780940 192.168.1.1.3022 > 192.168.1.78.56952: P 54896:55088(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781004 192.168.1.1.3022 > 192.168.1.78.56952: P 55088:55280(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781067 192.168.1.1.3022 > 192.168.1.78.56952: P 55280:55472(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781129 192.168.1.1.3022 > 192.168.1.78.56952: P 55472:55664(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781192 192.168.1.1.3022 > 192.168.1.78.56952: P 55664:55856(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781254 192.168.1.1.3022 > 192.168.1.78.56952: P 55856:56048(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781317 192.168.1.1.3022 > 192.168.1.78.56952: P 56048:56240(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781379 192.168.1.1.3022 > 192.168.1.78.56952: P 56240:56432(192) ack 49 win 11392 <nop,nop,timestamp 304232697 64082237> (DF) [tos 0x10] 14:08:51.781417 192.168.1.78.56952 > 192.168.1.1.3022: . ack 56048 win 8520 <nop,nop,timestamp 64082237 304232697> (DF) [tos 0x10] |
$ping 192.168.2.254
PING 192.168.2.254 (192.168.2.254) 56(84) bytes of data. 64 bytes from 192.168.2.254: icmp_seq=0 ttl=64 time=1.24 ms --- 192.168.2.254 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 1.244/1.244/1.244/0.000 ms, pipe 2 |
$sudo iptables -t nat -L PREROUTING
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 |
$sudo route -n
Password: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 80.78.40.160 0.0.0.0 255.255.255.240 U 0 0 0 eth1 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 |
$sudo iptables -t nat -L PREROUTING -p tcp --dport 25 -j DNAT --to 192.168.2.254
![]() iptables v1.3.3: Illegal option `-p' with this command Try `iptables -h' or 'iptables --help' for more information. |
$sudo iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to 192.168.2.254
|
$sudo iptables -t nat -A PREROUTING -p tcp --dport 110 -j DNAT --to 192.168.2.254
|
$telnet 192.168.1.72 110
![]() Trying 192.168.1.72... |
$telnet 192.168.1.78 110
![]() Trying 192.168.1.78... telnet: connect to address 192.168.1.78: Connection refused telnet: Unable to connect to remote host: Connection refused |
$ping 192.168.2.254
PING 192.168.2.254 (192.168.2.254) 56(84) bytes of data. 64 bytes from 192.168.2.254: icmp_seq=0 ttl=64 time=0.212 ms --- 192.168.2.254 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.212/0.212/0.212/0.000 ms, pipe 2 |
$sudo route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 80.78.40.160 0.0.0.0 255.255.255.240 U 0 0 0 eth1 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0 eth1 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 |
$sudo route del default gw 192.168.1.1
|
$sudo route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 80.78.40.160 0.0.0.0 255.255.255.240 U 0 0 0 eth1 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0 eth1 |
$ping mail.ru
![]() ping: unknown host mail.ru |
$sudo vi /etc/resolv.conf
|
$sudo /etc/init.d/named restart
Stopping named: [ ОК ] Starting named: [ ОК ] |
$host mail.ru
![]() |
$ping 192.168.2.254
PING 192.168.2.254 (192.168.2.254) 56(84) bytes of data. 64 bytes from 192.168.2.254: icmp_seq=0 ttl=64 time=0.229 ms --- 192.168.2.254 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.229/0.229/0.229/0.000 ms, pipe 2 |
$host mail.ru
mail.ru has address 194.67.57.26 mail.ru mail is handled by 10 mxs.mail.ru. |
$sudo iptables -L
Password: Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ... ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:imap flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$ping mail.ru
PING mail.ru (194.67.57.26) 56(84) bytes of data. 64 bytes from mail.ru (194.67.57.26): icmp_seq=0 ttl=112 time=120 ms --- mail.ru ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 120.918/120.918/120.918/0.000 ms, pipe 2 |
$telnet 192.168.2.254 110
Trying 192.168.2.254... Connected to 192.168.2.254 (192.168.2.254). Escape character is '^]'. +OK <28836.1141647363@region.tbih-sb.com.ua> ^]q telnet> q Connection closed. |
$sudo iptables -L -t net
![]() iptables v1.3.3: can't initialize iptables table `net': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7881 packets, 988K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 24 1152 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 0 0 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$cat /proc/sys/net/ipv4/ip_forward
0 |
$sudo 'echo 1 > /proc/sys/net/ipv4/ip_forward'
![]() sudo: echo 1 > /proc/sys/net/ipv4/ip_forward: command not found |
$sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
|
$sudo /etc/sysctl.conf
![]() sudo: /etc/sysctl.conf: command not found |
$sudo vi /etc/sysctl.conf
|
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7910 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 26 1248 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 2 96 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 26 1248 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 2 96 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 26 1248 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 2 96 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 27 1296 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 3 144 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 27 1296 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 3 144 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 27 1296 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 3 144 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat -v
Chain PREROUTING (policy ACCEPT 7912 packets, 994K bytes) pkts bytes target prot opt in out source destination 1 60 REDIRECT tcp -- eth0 any 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 3 144 DNAT tcp -- any any anywhere anywhere tcp dpt:smtp to:192.168.2.254 27 1296 DNAT tcp -- any any anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination 3 144 SNAT all -- any eth1 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT 2163 packets, 134K bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L
Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:3022 flags:SYN,RST,ACK/SYN ... ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:imap flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L -vn
Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 23 8553 ACCEPT all -- eth1 * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 224K 78M ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0 33429 10M ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 flags:0x16/0x02 9 432 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3022 flags:0x16/0x02 ... 17 816 ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 flags:0x16/0x02 1 48 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 flags:0x16/0x02 0 0 ACCEPT all -- eth0 eth0 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT 186K packets, 48M bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -t nat -A PREROUTING -p tcp --dport 110 -j DNAT --to 192.168.2.254:110
|
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -t nat -D PREROUTING 3
|
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$ERROR: recv: Connection reset by peer
[1]+ Broken pipe rdesktop -a 16 192.168.1.11 |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L
Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:3022 flags:SYN,RST,ACK/SYN ... ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:imap flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L -nv
Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 29 9047 ACCEPT all -- eth1 * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 226K 78M ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0 33451 10M ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 flags:0x16/0x02 9 432 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3022 flags:0x16/0x02 ... 32 1536 ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:25 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 flags:0x16/0x02 1 48 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:110 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 flags:0x16/0x02 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 flags:0x16/0x02 0 0 ACCEPT all -- eth0 eth0 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT 188K packets, 49M bytes) pkts bytes target prot opt in out source destination |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo ifconfig
eth0 Link encap:Ethernet HWaddr 00:13:8F:6D:4B:AB inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:8fff:fe6d:4bab/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:404762 errors:0 dropped:0 overruns:0 frame:0 TX packets:215308 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:126451266 (120.5 MiB) TX bytes:45546775 (43.4 MiB) Interrupt:10 Base address:0x8c00 eth1 Link encap:Ethernet HWaddr 00:0E:2E:32:46:15 ... UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:5 Base address:0x6400 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:45836 errors:0 dropped:0 overruns:0 frame:0 TX packets:45836 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16966873 (16.1 MiB) TX bytes:16966873 (16.1 MiB) |
$sudo ifconfig eth1 192.168.2.1
![]() SIOCSIFADDR: File exists |
$sudo ifconfig eth1:0
eth1:0 Link encap:Ethernet HWaddr 00:0E:2E:32:46:15 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:5 Base address:0x6400 |
$sudo ifconfig eth1:0 down
|
$sudo ifconfig eth1 192.168.2.1
|
$sudo ifconfig
eth0 Link encap:Ethernet HWaddr 00:13:8F:6D:4B:AB inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::213:8fff:fe6d:4bab/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:404792 errors:0 dropped:0 overruns:0 frame:0 TX packets:215308 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:126453674 (120.5 MiB) TX bytes:45546775 (43.4 MiB) Interrupt:10 Base address:0x8c00 eth1 Link encap:Ethernet HWaddr 00:0E:2E:32:46:15 ... RX bytes:252256 (246.3 KiB) TX bytes:43501 (42.4 KiB) Interrupt:5 Base address:0x6400 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:45836 errors:0 dropped:0 overruns:0 frame:0 TX packets:45836 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16966873 (16.1 MiB) TX bytes:16966873 (16.1 MiB) |
$sudo iptables -L
Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:3022 flags:SYN,RST,ACK/SYN ... ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:imap flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN ACCEPT tcp -- anywhere anywhere tcp dpt:https flags:SYN,RST,ACK/SYN ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -L -t nat
Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 DNAT tcp -- anywhere anywhere tcp dpt:smtp to:192.168.2.254 DNAT tcp -- anywhere anywhere tcp dpt:pop3 to:192.168.2.254:110 Chain POSTROUTING (policy ACCEPT) target prot opt source destination SNAT all -- 192.168.1.0/24 anywhere to:80.78.40.174 Chain OUTPUT (policy ACCEPT) target prot opt source destination |
$sudo iptables -F POSTROUTING
![]() iptables: No chain/target/match by that name |
0
Время первой команды журнала | 13:19:46 2006- 3- 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:24:43 2006- 3- 6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.79 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.08 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.56 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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