/l3/users/eb/2009/linux13/root :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 :31 :32 :33 :34 :35 :36 :37 :38 :39 :40 :41 :42 :43 :44 :45 :46 :47 :48 :49 :50 :51 :52 :53 :54 :55 :56 :57 :58 :59 :60 :61 :62 :63 :64 :65 :66 :67 :68 :69 :70 :71 :72 :73 :74 :75 :76 |
|
#route del 192.168.0.108
SIOCDELRT: No such process |
#route del 192.168.0.108 gw 172.16.1.8
SIOCDELRT: No such process |
#eoute
bash: eoute: command not found |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.252 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#eoute
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.252 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#192.168.0.108 gw 172.16.1.8
2 proto tcp-server 3 route 192.168.108.1/24 secret my.key 7 #remote 192.168.208.2 ~ ~ ~ ~ ~ ~ ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "server.conf" 7L, 124C written |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.252 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#vim server.conf
--- /tmp/l3-saved-3792.20634.22314 2009-06-03 18:26:42.000000000 +0300 +++ server.conf 2009-06-03 18:26:55.000000000 +0300 @@ -2,6 +2,6 @@ proto tcp-server dev tun ifconfig 172.16.1.7 172.16.1.8 -route 192.168.108.1/24 +route 192.168.108.0/24 secret my.key #remote 192.168.208.2 |
#ssh 192.168.108.1
ssh_exchange_identification: Connection closed by remote host |
#ping 192.168.108.1
PING 192.168.108.1 (192.168.108.1) 56(84) bytes of data. 64 bytes from 192.168.108.1: icmp_seq=1 ttl=64 time=0.429 ms 64 bytes from 192.168.108.1: icmp_seq=2 ttl=64 time=0.429 ms ^C --- 192.168.108.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.429/0.429/0.429/0.000 ms |
#ssh 192.168.108.1
ssh_exchange_identification: Connection closed by remote host |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.252 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#vim server.conf
--- /tmp/l3-saved-3792.14149.24557 2009-06-03 18:30:06.000000000 +0300 +++ server.conf 2009-06-03 18:32:48.000000000 +0300 @@ -2,6 +2,6 @@ proto tcp-server dev tun ifconfig 172.16.1.7 172.16.1.8 -route 192.168.108.0/24 +route 192.168.108.0 255.255.255.0 secret my.key #remote 192.168.208.2 |
#traceroute www.google.com
traceroute to www.google.com (74.125.87.99), 30 hops max, 60 byte packets 1 192.168.207.1 (192.168.207.1) 1.010 ms 1.201 ms 1.394 ms 2 10.0.35.1 (10.0.35.1) 0.362 ms 0.354 ms 0.346 ms 3 * * * 4 * * * 5 * * * 6 * * * 7 * * * 8 *^C |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.252 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#vim server.conf
|
#~
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#192.168.0.108 gw 172.16.1.8
/etc/init.d/openvpn restart Stopping virtual private network daemon: server. Starting virtual private network daemon: server. |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.0 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#iptables -A MSQUARADE -j SNAT
iptables v1.4.3.2: You must specify --to-source Try `iptables -h' or 'iptables --help' for more information. |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.0 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#iptables -A MASQUERADE -o eth0.207 -j POSTROUTING
iptables v1.4.3.2: Couldn't load target `POSTROUTING':/lib/xtables/libipt_POSTROUTING.so: cannot open shared object file: No such file or directory Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A POSTROUTING -o eth0.207 -j MASQUERADE
iptables: No chain/target/match by that name. |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:46:20 2009 *filter :INPUT ACCEPT [259:22192] :FORWARD ACCEPT [25:1670] :OUTPUT ACCEPT [149:13943] COMMIT # Completed on Wed Jun 3 18:46:20 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:47:44 2009 *nat :PREROUTING ACCEPT [6:524] :POSTROUTING ACCEPT [5:453] :OUTPUT ACCEPT [1:228] -A POSTROUTING -o eth0.207 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:47:44 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:47:44 2009 *filter :INPUT ACCEPT [682:58456] :FORWARD ACCEPT [77:4980] :OUTPUT ACCEPT [402:41446] COMMIT # Completed on Wed Jun 3 18:47:44 2009 |
#ping www.google.com
PING www.l.google.com (74.125.87.147) 56(84) bytes of data. ^C --- www.l.google.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1002ms |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.190 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.222 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.222 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.190/0.211/0.222/0.019 ms |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.0 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:48:43 2009 *nat :PREROUTING ACCEPT [26:1733] :POSTROUTING ACCEPT [37:2494] :OUTPUT ACCEPT [15:1180] -A POSTROUTING -o eth0.207 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:48:43 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:48:43 2009 *filter :INPUT ACCEPT [886:80116] :FORWARD ACCEPT [146:10211] :OUTPUT ACCEPT [562:55086] COMMIT # Completed on Wed Jun 3 18:48:43 2009 |
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data. 64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=8.44 ms 64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.611 ms ^C --- 192.168.15.254 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.611/4.527/8.444/3.917 ms |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:45 2009 *nat :PREROUTING ACCEPT [46:2929] :POSTROUTING ACCEPT [62:3992] :OUTPUT ACCEPT [22:1602] -A POSTROUTING -o eth0.207 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:45 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:45 2009 *filter :INPUT ACCEPT [1234:114562] :FORWARD ACCEPT [259:18705] :OUTPUT ACCEPT [848:106743] COMMIT # Completed on Wed Jun 3 18:49:45 2009 |
#iptables-save > 1
|
#vi 1
--- /tmp/l3-saved-7065.30009.6996 2009-06-03 18:50:01.000000000 +0300 +++ 1 2009-06-03 18:51:48.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -o eth0.207 -p tcp -m tcp -j MASQUERADE +-A POSTROUTING -o eth0.207 -p tcp -m tcp -i tun0 -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.0 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.191 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.224 ms ^C --- 10.0.35.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.191/0.207/0.224/0.021 ms |
#iptables-restore<1
iptables-restore v1.4.3.2: Can't use -i with POSTROUTING Error occurred at line: 6 Try `iptables-restore -h' or 'iptables-restore --help' for more information. |
#vi 1
--- /tmp/l3-saved-7065.18506.27225 2009-06-03 18:52:00.000000000 +0300 +++ 1 2009-06-03 18:52:36.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -o eth0.207 -p tcp -m tcp -i tun0 -j MASQUERADE +-A POSTROUTING -o eth0.207 -p tcp -m tcp -s 172.16.1.7 -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
|
#ping 192.168.15.254
PING 192.168.15.254 (192.168.15.254) 56(84) bytes of data. 64 bytes from 192.168.15.254: icmp_seq=1 ttl=64 time=0.605 ms 64 bytes from 192.168.15.254: icmp_seq=2 ttl=64 time=0.587 ms 64 bytes from 192.168.15.254: icmp_seq=3 ttl=64 time=0.601 ms ^C --- 192.168.15.254 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.587/0.597/0.605/0.029 ms |
#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 172.16.1.8 * 255.255.255.255 UH 0 0 0 tun0 192.168.108.0 172.16.1.8 255.255.255.0 UG 0 0 0 tun0 192.168.15.0 * 255.255.255.0 U 0 0 0 eth0 192.168.207.0 * 255.255.255.0 U 0 0 0 eth0.207 192.168.107.0 * 255.255.255.0 U 0 0 0 eth0.107 default 192.168.207.1 0.0.0.0 UG 0 0 0 eth0.207 |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.187 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.223 ms ^C --- 10.0.35.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.187/0.205/0.223/0.018 ms |
#vi 1
--- /tmp/l3-saved-7065.22145.25126 2009-06-03 18:53:15.000000000 +0300 +++ 1 2009-06-03 18:53:29.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -o eth0.207 -p tcp -m tcp -s 172.16.1.7 -j MASQUERADE +-A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:42 2009 *nat :PREROUTING ACCEPT [5:662] :POSTROUTING ACCEPT [3:189] :OUTPUT ACCEPT [0:0] -A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:53:42 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:42 2009 *filter :INPUT ACCEPT [91:14090] :FORWARD ACCEPT [27:2128] :OUTPUT ACCEPT [80:5568] COMMIT # Completed on Wed Jun 3 18:53:42 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:51 2009 *nat :PREROUTING ACCEPT [7:774] :POSTROUTING ACCEPT [5:301] :OUTPUT ACCEPT [0:0] -A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:53:51 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:51 2009 *filter :INPUT ACCEPT [129:18134] :FORWARD ACCEPT [49:3832] :OUTPUT ACCEPT [116:8752] COMMIT # Completed on Wed Jun 3 18:53:51 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:52 2009 *nat :PREROUTING ACCEPT [8:826] :POSTROUTING ACCEPT [6:353] :OUTPUT ACCEPT [0:0] -A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:53:52 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:52 2009 *filter :INPUT ACCEPT [151:19594] :FORWARD ACCEPT [52:4052] :OUTPUT ACCEPT [136:11104] COMMIT # Completed on Wed Jun 3 18:53:52 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:53 2009 *nat :PREROUTING ACCEPT [8:826] :POSTROUTING ACCEPT [6:353] :OUTPUT ACCEPT [0:0] -A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:53:53 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:53:53 2009 *filter :INPUT ACCEPT [171:20856] :FORWARD ACCEPT [54:4220] :OUTPUT ACCEPT [155:13404] COMMIT # Completed on Wed Jun 3 18:53:53 2009 |
#vi 1
|
#traceroute 10.1.0.35
traceroute to 10.1.0.35 (10.1.0.35), 30 hops max, 60 byte packets 1 192.168.207.1 (192.168.207.1) 7.777 ms 8.161 ms 8.351 ms 2 10.0.35.1 (10.0.35.1) 8.748 ms 9.145 ms 9.336 ms 3 * * * 4 * * * 5 * * * 6 * * * 7 * * * 8 *^C |
#vi 1
--- /tmp/l3-saved-8391.13232.47 2009-06-03 19:00:02.000000000 +0300 +++ 1 2009-06-03 19:01:26.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -p tcp -m tcp -j MASQUERADE +-A POSTROUTING -p tcp -m tcp -j SNAT --random COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:55:58 2009 *nat :PREROUTING ACCEPT [3:172] :POSTROUTING ACCEPT [3:172] :OUTPUT ACCEPT [0:0] -A POSTROUTING -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:55:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:55:58 2009 *filter :INPUT ACCEPT [48:4614] :FORWARD ACCEPT [19:1468] :OUTPUT ACCEPT [37:3530] COMMIT # Completed on Wed Jun 3 18:55:58 2009 |
#iptables --help
iptables v1.4.3.2 Usage: iptables -[AD] chain rule-specification [options] iptables -I chain [rulenum] rule-specification [options] iptables -R chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LS] [chain [rulenum]] [options] iptables -[FZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] ... [!] --out-interface -o output name[+] network interface name ([+] for wildcard) --table -t table table to manipulate (default: `filter') --verbose -v verbose mode --line-numbers print line numbers when listing --exact -x expand numbers (display exact values) [!] --fragment -f match second or further fragments only --modprobe=<command> try to insert modules using this command --set-counters PKTS BYTES set the counter during insert/append [!] --version -V print package version. |
#ssh 192.168.202.1
The authenticity of host '192.168.202.1 (192.168.202.1)' can't be established. RSA key fingerprint is 7e:ed:6a:01:cb:0b:a2:37:07:c5:64:c0:e0:23:f1:e4. Are you sure you want to continue connecting (yes/no)? no Host key verification failed. |
#iptables --help POSTROUTING
iptables v1.4.3.2 Usage: iptables -[AD] chain rule-specification [options] iptables -I chain [rulenum] rule-specification [options] iptables -R chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LS] [chain [rulenum]] [options] iptables -[FZ] [chain] [options] iptables -[NX] chain iptables -E old-chain-name new-chain-name iptables -P chain target [options] ... [!] --out-interface -o output name[+] network interface name ([+] for wildcard) --table -t table table to manipulate (default: `filter') --verbose -v verbose mode --line-numbers print line numbers when listing --exact -x expand numbers (display exact values) [!] --fragment -f match second or further fragments only --modprobe=<command> try to insert modules using this command --set-counters PKTS BYTES set the counter during insert/append [!] --version -V print package version. |
#netstat -na
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 192.168.107.1:22 192.168.107.2:32852 ESTABLISHED tcp 0 0 192.168.207.2:37311 192.168.202.1:22 TIME_WAIT tcp 0 0 192.168.15.13:40462 10.0.35.100:22 ESTABLISHED tcp 0 0 192.168.107.1:22 192.168.107.2:35888 ESTABLISHED tcp 0 0 192.168.207.2:443 192.168.208.2:42986 ESTABLISHED ... unix 3 [ ] STREAM CONNECTED 10883 /dev/log unix 3 [ ] STREAM CONNECTED 10880 unix 3 [ ] STREAM CONNECTED 10548 /dev/log unix 3 [ ] STREAM CONNECTED 10547 unix 3 [ ] STREAM CONNECTED 10389 /dev/log unix 3 [ ] STREAM CONNECTED 10388 unix 3 [ ] STREAM CONNECTED 10323 /dev/log unix 3 [ ] STREAM CONNECTED 10322 unix 3 [ ] STREAM CONNECTED 10028 unix 3 [ ] STREAM CONNECTED 10027 |
#netstat -lnp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 3502/inetd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5476/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3477/exim4 tcp6 0 0 :::80 :::* LISTEN 3611/apache2 tcp6 0 0 :::22 :::* LISTEN 5476/sshd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 10000 3181/syslog-ng /dev/log unix 2 [ ACC ] STREAM LISTENING 10024 3191/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 10334 3494/lpd /dev/printer unix 2 [ ACC ] STREAM LISTENING 10528 3613/apache2 /var/run/apache2/cgisock.3611 unix 2 [ ACC ] STREAM LISTENING 10900 3756/ssh-agent /tmp/ssh-QqEDNm3755/agent.3755 |
#netstat -lnp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 3502/inetd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5476/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3477/exim4 tcp6 0 0 :::80 :::* LISTEN 3611/apache2 tcp6 0 0 :::22 :::* LISTEN 5476/sshd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 10000 3181/syslog-ng /dev/log unix 2 [ ACC ] STREAM LISTENING 10024 3191/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 10334 3494/lpd /dev/printer unix 2 [ ACC ] STREAM LISTENING 10528 3613/apache2 /var/run/apache2/cgisock.3611 unix 2 [ ACC ] STREAM LISTENING 10900 3756/ssh-agent /tmp/ssh-QqEDNm3755/agent.3755 |
#netstat -lnp
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 3502/inetd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5476/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3477/exim4 tcp6 0 0 :::80 :::* LISTEN 3611/apache2 tcp6 0 0 :::22 :::* LISTEN 5476/sshd Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node PID/Program name Path unix 2 [ ACC ] STREAM LISTENING 10000 3181/syslog-ng /dev/log unix 2 [ ACC ] STREAM LISTENING 10024 3191/dbus-daemon /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 10334 3494/lpd /dev/printer unix 2 [ ACC ] STREAM LISTENING 10528 3613/apache2 /var/run/apache2/cgisock.3611 unix 2 [ ACC ] STREAM LISTENING 10900 3756/ssh-agent /tmp/ssh-QqEDNm3755/agent.3755 |
#/etc/openvpn/openvpn status
bash: /etc/openvpn/openvpn: No such file or directory |
#/etc/init.d/openvpn status
Usage: /etc/init.d/openvpn {start|stop|reload|restart|force-reload|cond-restart} |
#tail -F /var/log/daemon.log
Jun 3 19:01:26 linux13 ovpn-server[7870]: SIGUSR1[soft,connection-reset] received, process restarting Jun 3 19:01:27 linux13 ovpn-server[7870]: /usr/sbin/openvpn-vulnkey -q my.key Jun 3 19:01:27 linux13 ovpn-server[7870]: TUN/TAP device tun0 opened Jun 3 19:01:27 linux13 ovpn-server[7870]: /sbin/ifconfig tun0 172.16.1.7 pointopoint 172.16.1.8 mtu 1500 Jun 3 19:01:27 linux13 ovpn-server[7870]: Listening for incoming TCP connection on [undef]:443 Jun 3 19:01:31 linux13 ovpn-server[7870]: TCP connection established with 192.168.208.2:42994 Jun 3 19:01:31 linux13 ovpn-server[7870]: TCPv4_SERVER link local (bound): [undef]:443 Jun 3 19:01:31 linux13 ovpn-server[7870]: TCPv4_SERVER link remote: 192.168.208.2:42994 Jun 3 19:01:32 linux13 ovpn-server[7870]: Peer Connection Initiated with 192.168.208.2:42994 Jun 3 19:01:32 linux13 ovpn-server[7870]: Initialization Sequence Completed ... Jun 3 19:07:36 linux13 ovpn-server[7870]: /usr/sbin/openvpn-vulnkey -q my.key Jun 3 19:07:36 linux13 ovpn-server[7870]: TUN/TAP device tun0 opened Jun 3 19:07:36 linux13 ovpn-server[7870]: /sbin/ifconfig tun0 172.16.1.7 pointopoint 172.16.1.8 mtu 1500 Jun 3 19:07:36 linux13 ovpn-server[7870]: Listening for incoming TCP connection on [undef]:443 Jun 3 19:07:41 linux13 ovpn-server[7870]: TCP connection established with 192.168.208.2:60523 Jun 3 19:07:41 linux13 ovpn-server[7870]: TCPv4_SERVER link local (bound): [undef]:443 Jun 3 19:07:41 linux13 ovpn-server[7870]: TCPv4_SERVER link remote: 192.168.208.2:60523 Jun 3 19:07:41 linux13 ovpn-server[7870]: Peer Connection Initiated with 192.168.208.2:60523 Jun 3 19:07:42 linux13 ovpn-server[7870]: Initialization Sequence Completed ^C |
#iptables-restore<1
iptables-restore v1.4.3.2: You must specify --to-source Error occurred at line: 6 Try `iptables-restore -h' or 'iptables-restore --help' for more information. |
#vi 1
--- /tmp/l3-saved-8391.9592.1157 2009-06-03 19:01:36.000000000 +0300 +++ 1 2009-06-03 19:02:42.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -p tcp -m tcp -j SNAT --random +-A POSTROUTING -p tcp -m tcp -s 192.168.107.0/24-j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
Bad argument `MASQUERADE' Error occurred at line: 6 Try `iptables-restore -h' or 'iptables-restore --help' for more information. |
#vi 1
--- /tmp/l3-saved-8391.26430.30758 2009-06-03 19:02:49.000000000 +0300 +++ 1 2009-06-03 19:03:52.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -p tcp -m tcp -s 192.168.107.0/24-j MASQUERADE +-A POSTROUTING -p tcp -m tcp -s 192.168.107.0/24 -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
|
#nat-stat
bash: nat-stat: command not found |
#vi 1
--- /tmp/l3-saved-8391.8854.8024 2009-06-03 19:04:28.000000000 +0300 +++ 1 2009-06-03 19:04:44.000000000 +0300 @@ -3,7 +3,7 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -p tcp -m tcp -s 192.168.107.0/24 -j MASQUERADE +-A POSTROUTING -p tcp -m tcp -s 0.0.0.0 -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
|
#vi 1
|
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
|
#cat 2
|
#iptables-restore<2
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:05:48 2009 *nat :PREROUTING ACCEPT [37:2525] :POSTROUTING ACCEPT [41:2407] :OUTPUT ACCEPT [7:415] -A POSTROUTING -s 0.0.0.0/32 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 19:05:48 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:05:48 2009 *filter :INPUT ACCEPT [300:30867] :FORWARD ACCEPT [162:12360] :OUTPUT ACCEPT [222:20023] COMMIT # Completed on Wed Jun 3 19:05:48 2009 |
#echo '' >2
|
#iptables-restore<2
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:06:06 2009 *nat :PREROUTING ACCEPT [41:2749] :POSTROUTING ACCEPT [48:2812] :OUTPUT ACCEPT [10:596] -A POSTROUTING -s 0.0.0.0/32 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 19:06:06 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:06:06 2009 *filter :INPUT ACCEPT [408:40520] :FORWARD ACCEPT [200:15360] :OUTPUT ACCEPT [298:27272] COMMIT # Completed on Wed Jun 3 19:06:06 2009 |
#echo ' ' >2
|
#iptables-restore<2
iptables-restore: line 1 failed |
#iptables -F
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:06:29 2009 *nat :PREROUTING ACCEPT [50:3257] :POSTROUTING ACCEPT [58:3382] :OUTPUT ACCEPT [12:718] -A POSTROUTING -s 0.0.0.0/32 -p tcp -m tcp -j MASQUERADE COMMIT # Completed on Wed Jun 3 19:06:29 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:06:29 2009 *filter :INPUT ACCEPT [550:54238] :FORWARD ACCEPT [257:19748] :OUTPUT ACCEPT [402:36758] COMMIT # Completed on Wed Jun 3 19:06:29 2009 |
#vi 1
--- /tmp/l3-saved-8391.6624.31777 2009-06-03 19:06:37.000000000 +0300 +++ 1 2009-06-03 19:06:55.000000000 +0300 @@ -3,7 +3,6 @@ :PREROUTING ACCEPT [49:3101] :POSTROUTING ACCEPT [65:4164] :OUTPUT ACCEPT [22:1602] --A POSTROUTING -p tcp -m tcp -s 0.0.0.0 -j MASQUERADE COMMIT # Completed on Wed Jun 3 18:49:58 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 18:49:58 2009 |
#iptables-restore<1
|
#iptables-save
# Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:07:08 2009 *nat :PREROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] COMMIT # Completed on Wed Jun 3 19:07:08 2009 # Generated by iptables-save v1.4.3.2 on Wed Jun 3 19:07:08 2009 *filter :INPUT ACCEPT [38:3632] :FORWARD ACCEPT [11:892] :OUTPUT ACCEPT [27:2720] COMMIT # Completed on Wed Jun 3 19:07:08 2009 |
#iptables -A -p ip -j MASQUERADE
Bad argument `ip' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A -p tcp -j MASQUERADE
Bad argument `tcp' Try `iptables -h' or 'iptables --help' for more information. |
#iptables -A POSTROUTING -p tcp -j MASQUERADE
iptables: No chain/target/match by that name. |
#iptables -A POSTROUTING -m tcp -j MASQUERADE
iptables: No chain/target/match by that name. |
#iptables -A POSTROUTING -t nat -m tcp -j MASQUERADE
iptables: Invalid argument. Run `dmesg' for more information. |
#dmesg
[ 4.010559] usb usb5: SerialNumber: 0000:00:1d.0 [ 4.010647] usb usb5: configuration #1 chosen from 1 choice [ 4.010718] hub 5-0:1.0: USB hub found [ 4.010765] hub 5-0:1.0: 2 ports detected [ 4.010913] uhci_hcd 0000:00:1d.1: PCI INT B -> GSI 20 (level, low) -> IRQ 20 [ 4.010969] uhci_hcd 0000:00:1d.1: setting latency timer to 64 [ 4.010972] uhci_hcd 0000:00:1d.1: UHCI Host Controller [ 4.011038] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 6 [ 4.011129] uhci_hcd 0000:00:1d.1: irq 20, io base 0x0000d400 [ 4.011203] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001 ... [10104.693945] tun0: Disabled Privacy Extensions [10150.046021] tun0: Disabled Privacy Extensions [10196.410281] tun0: Disabled Privacy Extensions [10242.658087] tun0: Disabled Privacy Extensions [10288.122865] tun0: Disabled Privacy Extensions [10334.069989] tun0: Disabled Privacy Extensions [10380.858029] tun0: Disabled Privacy Extensions [10426.202956] tun0: Disabled Privacy Extensions [10440.779168] tun0: Disabled Privacy Extensions [10500.236604] ip_tables: tcp match: only valid for protocol 6 |
Время первой команды журнала | 18:23:06 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 19:09:35 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 20.79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 2.17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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