/l3/users/eb/2009/linux3/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 |
|
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.15.254 dev eth0 |
#ip route add default via 192.168.201.1 dev eth0.201 table P1
Error: argument "P1" is wrong: "table" value is invalid |
#ip route add default via 192.168.201.1 dev eth0.201 table P1
Error: argument "P1" is wrong: "table" value is invalid |
#ping 192.168.211.2
PING 192.168.211.2 (192.168.211.2) 56(84) bytes of data. 64 bytes from 192.168.211.2: icmp_seq=1 ttl=63 time=3.54 ms 64 bytes from 192.168.211.2: icmp_seq=2 ttl=63 time=0.168 ms 64 bytes from 192.168.211.2: icmp_seq=3 ttl=63 time=0.135 ms ^C --- 192.168.211.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2000ms rtt min/avg/max/mdev = 0.135/1.282/3.543/1.598 ms |
#ping 192.168.211.2
PING 192.168.211.2 (192.168.211.2) 56(84) bytes of data. 64 bytes from 192.168.211.2: icmp_seq=1 ttl=63 time=3.54 ms 64 bytes from 192.168.211.2: icmp_seq=2 ttl=63 time=0.168 ms 64 bytes from 192.168.211.2: icmp_seq=3 ttl=63 time=0.135 ms ^C --- 192.168.211.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2000ms rtt min/avg/max/mdev = 0.135/1.282/3.543/1.598 ms |
#ping -I 192.168.201.2 10.0.35.1
PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.188 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.236 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.238 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.188/0.220/0.238/0.028 ms |
#ping -I 192.168.201.2 10.0.35.1
PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.188 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.236 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.238 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.188/0.220/0.238/0.028 ms |
#vi /etc/openvpn/client.conf
--- /tmp/l3-saved-9497.28670.29277 2009-06-03 20:24:40.000000000 +0300 +++ /etc/openvpn/client.conf 2009-06-03 20:25:06.000000000 +0300 @@ -6,5 +6,6 @@ redirect-gateway secret linux1.key remote 192.168.201.2 +remote 192.168.211.2 ping 5 ping-restart 30 |
#ping -I 192.168.211.2 10.0.35.1
PING 10.0.35.1 (10.0.35.1) from 192.168.211.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.232 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.235 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.242 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.232/0.236/0.242/0.013 ms |
#ping -I 192.168.211.2 10.0.35.1
PING 10.0.35.1 (10.0.35.1) from 192.168.211.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.232 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.235 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.242 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.232/0.236/0.242/0.013 ms |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. ^C --- 10.0.35.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1009ms |
#ping 10.0.35.1
PING 10.0.35.1 (10.0.35.1) 56(84) bytes of data. ^C --- 10.0.35.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1009ms |
#traceroute -n 10.0.35.1
traceroute to 10.0.35.1 (10.0.35.1), 30 hops max, 60 byte packets 1 192.168.201.1 0.866 ms 1.249 ms 1.440 ms 2 10.0.35.1 0.339 ms 0.326 ms 0.314 ms |
#traceroute -n 10.0.35.1
traceroute to 10.0.35.1 (10.0.35.1), 30 hops max, 60 byte packets 1 192.168.201.1 0.866 ms 1.249 ms 1.440 ms 2 10.0.35.1 0.339 ms 0.326 ms 0.314 ms |
#traceroute -n 10.0.35.1
traceroute to 10.0.35.1 (10.0.35.1), 30 hops max, 60 byte packets 1 172.16.1.1 0.535 ms 0.607 ms 0.659 ms 2 * * * 3 * * * 4 * * * 5 * * * 6 * * * 7 *^C |
#traceroute -n 10.0.35.1
traceroute to 10.0.35.1 (10.0.35.1), 30 hops max, 60 byte packets 1 172.16.1.1 0.535 ms 0.607 ms 0.659 ms 2 * * * 3 * * * 4 * * * 5 * * * 6 * * * 7 *^C |
#ip route
10.0.35.100 via 192.168.15.254 dev eth0 192.168.211.2 via 192.168.202.1 dev eth0.202 172.16.1.1 dev tun0 proto kernel scope link src 172.16.1.2 192.168.102.0/24 dev eth0.102 proto kernel scope link src 192.168.102.1 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.3 192.168.202.0/24 dev eth0.202 proto kernel scope link src 192.168.202.2 default via 172.16.1.1 dev tun0 |
#ip route
10.0.35.100 via 192.168.15.254 dev eth0 192.168.211.2 via 192.168.202.1 dev eth0.202 172.16.1.1 dev tun0 proto kernel scope link src 172.16.1.2 192.168.102.0/24 dev eth0.102 proto kernel scope link src 192.168.102.1 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.3 192.168.202.0/24 dev eth0.202 proto kernel scope link src 192.168.202.2 default via 172.16.1.1 dev tun0 |
#iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 2094 packets, 149K bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 2317 packets, 138K bytes) pkts bytes target prot opt in out source destination 912 55258 MASQUERADE all -- any eth0 anywhere anywhere Chain OUTPUT (policy ACCEPT 1428 packets, 87044 bytes) pkts bytes target prot opt in out source destination |
#iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 2094 packets, 149K bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 2317 packets, 138K bytes) pkts bytes target prot opt in out source destination 912 55258 MASQUERADE all -- any eth0 anywhere anywhere Chain OUTPUT (policy ACCEPT 1428 packets, 87044 bytes) pkts bytes target prot opt in out source destination |
#ip route add 10.0.35.1 via via 172.16.1.1 dev tun0
Error: an inet address is expected rather than "via". |
#ip route add 10.0.35.1 via via 172.16.1.1 dev tun0
Error: an inet address is expected rather than "via". |
#ip route
10.0.35.100 via 192.168.15.254 dev eth0 192.168.211.2 via 192.168.202.1 dev eth0.202 172.16.1.1 dev tun0 proto kernel scope link src 172.16.1.2 192.168.102.0/24 dev eth0.102 proto kernel scope link src 192.168.102.1 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.3 192.168.202.0/24 dev eth0.202 proto kernel scope link src 192.168.202.2 default via 172.16.1.1 dev tun0 |
#ip route
10.0.35.100 via 192.168.15.254 dev eth0 192.168.211.2 via 192.168.202.1 dev eth0.202 172.16.1.1 dev tun0 proto kernel scope link src 172.16.1.2 192.168.102.0/24 dev eth0.102 proto kernel scope link src 192.168.102.1 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.3 192.168.202.0/24 dev eth0.202 proto kernel scope link src 192.168.202.2 default via 172.16.1.1 dev tun0 |
#ssh 172.16.1.1 ps aux | grep super
The authenticity of host '172.16.1.1 (172.16.1.1)' can't be established. RSA key fingerprint is 54:b6:4e:a0:18:a4:c1:b1:8f:f5:64:59:31:ba:63:f5. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.16.1.1' (RSA) to the list of known hosts. |
#ssh 172.16.1.1 ps aux | grep super
The authenticity of host '172.16.1.1 (172.16.1.1)' can't be established. RSA key fingerprint is 54:b6:4e:a0:18:a4:c1:b1:8f:f5:64:59:31:ba:63:f5. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.16.1.1' (RSA) to the list of known hosts. |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#iptables -t nat -A POSTROUTING -o eth0.211 -j MASQUERADE
|
#cat super_route
IP1=192.168.201.2 IP2=192.168.211.2 GW1=192.168.201.1 GW2=192.168.211.1 while true do if ping -I $IP1 -c 1 10.0.35.1 then ip route change default $GW1 else ping -I $IP2 -c 1 10.0.35.1 && ip route change default $GW2 fi sleep 1 done |
#cat super_route
IP1=192.168.201.2 IP2=192.168.211.2 GW1=192.168.201.1 GW2=192.168.211.1 while true do if ping -I $IP1 -c 1 10.0.35.1 then ip route change default $GW1 else ping -I $IP2 -c 1 10.0.35.1 && ip route change default $GW2 fi sleep 1 done |
#./super_route &
[1] 21412 PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.259 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.259/0.259/0.259/0.000 ms |
#./super_route &
[1] 21412 PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.259 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.259/0.259/0.259/0.000 ms |
#Error: either "to" is duplicate, or "192.168.201.1" is a garbage.
PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.390 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.390/0.390/0.390/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.189 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.188 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.188/0.188/0.188/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#Error: either "to" is duplicate, or "192.168.201.1" is a garbage.
PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.390 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.390/0.390/0.390/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.189 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.188 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.188/0.188/0.188/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.185 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.185/0.185/0.185/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.238 ms --- 10.0.35.1 ping statistics --- ... 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.190/0.190/0.190/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. outPING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.189 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. e |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.185 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.185/0.185/0.185/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.238 ms --- 10.0.35.1 ping statistics --- ... 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.190/0.190/0.190/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. outPING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.189 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.189/0.189/0.189/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. e |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
rtt min/avg/max/mdev = 0.184/0.184/0.184/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.251 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.251/0.251/0.251/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.241 ms ... --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.241/0.241/0.241/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.389 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.389/0.389/0.389/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
rtt min/avg/max/mdev = 0.184/0.184/0.184/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.251 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.251/0.251/0.251/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.241 ms ... --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.241/0.241/0.241/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.389 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.389/0.389/0.389/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#ssh 172.16.1.1
l3-agent is already running: pid=4276; pidfile=/root/.lilalo/l3-agent.pid |
#ssh 172.16.1.1
l3-agent is already running: pid=4276; pidfile=/root/.lilalo/l3-agent.pid |
#ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2128 716 ? Ss 09:29 0:01 init [2] root 2 0.0 0.0 0 0 ? S< 09:29 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S< 09:29 0:00 [migration/0] root 4 0.0 0.0 0 0 ? S< 09:29 0:02 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< 09:29 0:00 [watchdog/0] root 6 0.0 0.0 0 0 ? S< 09:29 0:00 [migration/1] root 7 0.0 0.0 0 0 ? S< 09:29 0:00 [ksoftirqd/1] root 8 0.0 0.0 0 0 ? S< 09:29 0:00 [watchdog/1] root 9 0.0 0.0 0 0 ? S< 09:29 0:00 [cpuset] ... root 20676 0.0 0.0 4776 372 pts/2 S+ 19:52 0:00 script -f -c bash -q /root/.lilalo//3046815149107 root 20677 0.0 0.1 7400 3228 pts/9 Ss+ 19:52 0:00 bash root 21412 0.0 0.0 7400 2268 pts/9 S 20:57 0:00 bash root 22231 0.2 0.0 8600 3040 ? Ss 20:59 0:00 sshd: root@pts/5 root 22240 0.0 0.0 4772 556 pts/5 Ss+ 20:59 0:00 script -f -c bash -q /root/.lilalo//1589635942250 root 22325 0.0 0.0 4776 372 pts/5 S+ 20:59 0:00 script -f -c bash -q /root/.lilalo//1589635942250 root 22326 0.8 0.1 7400 3184 pts/8 Ss 20:59 0:00 bash root 22472 0.0 0.0 4776 508 pts/9 S 20:59 0:00 sleep 1 root 22473 0.0 0.0 5472 1056 pts/8 R+ 20:59 0:00 ps aux root 31510 0.0 0.0 4888 620 ? Ss 11:42 0:00 ssh-agent |
#ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 2128 716 ? Ss 09:29 0:01 init [2] root 2 0.0 0.0 0 0 ? S< 09:29 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S< 09:29 0:00 [migration/0] root 4 0.0 0.0 0 0 ? S< 09:29 0:02 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< 09:29 0:00 [watchdog/0] root 6 0.0 0.0 0 0 ? S< 09:29 0:00 [migration/1] root 7 0.0 0.0 0 0 ? S< 09:29 0:00 [ksoftirqd/1] root 8 0.0 0.0 0 0 ? S< 09:29 0:00 [watchdog/1] root 9 0.0 0.0 0 0 ? S< 09:29 0:00 [cpuset] ... root 20676 0.0 0.0 4776 372 pts/2 S+ 19:52 0:00 script -f -c bash -q /root/.lilalo//3046815149107 root 20677 0.0 0.1 7400 3228 pts/9 Ss+ 19:52 0:00 bash root 21412 0.0 0.0 7400 2268 pts/9 S 20:57 0:00 bash root 22231 0.2 0.0 8600 3040 ? Ss 20:59 0:00 sshd: root@pts/5 root 22240 0.0 0.0 4772 556 pts/5 Ss+ 20:59 0:00 script -f -c bash -q /root/.lilalo//1589635942250 root 22325 0.0 0.0 4776 372 pts/5 S+ 20:59 0:00 script -f -c bash -q /root/.lilalo//1589635942250 root 22326 0.8 0.1 7400 3184 pts/8 Ss 20:59 0:00 bash root 22472 0.0 0.0 4776 508 pts/9 S 20:59 0:00 sleep 1 root 22473 0.0 0.0 5472 1056 pts/8 R+ 20:59 0:00 ps aux root 31510 0.0 0.0 4888 620 ? Ss 11:42 0:00 ssh-agent |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.244 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.186 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.186/0.186/0.186/0.000 ms ... --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.187/0.187/0.187/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.240 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.240/0.240/0.240/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.244 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.186 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.186/0.186/0.186/0.000 ms ... --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.187/0.187/0.187/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.240 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.240/0.240/0.240/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.244 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.244 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.389 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.389/0.389/0.389/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. fg ./super_route PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.235 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.235/0.235/0.235/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.242 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.242/0.242/0.242/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. ^Z [1]+ Stopped ./super_route |
#PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data.
64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.389 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.389/0.389/0.389/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. fg ./super_route PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.235 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.235/0.235/0.235/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. PING 10.0.35.1 (10.0.35.1) from 192.168.201.2 : 56(84) bytes of data. 64 bytes from 10.0.35.1: icmp_seq=1 ttl=63 time=0.242 ms --- 10.0.35.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.242/0.242/0.242/0.000 ms Error: either "to" is duplicate, or "192.168.201.1" is a garbage. ^Z [1]+ Stopped ./super_route |
#vi super_route
|
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.211.1 dev eth0.211 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.211.1 dev eth0.211 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#ip route
172.16.1.2 dev tun0 proto kernel scope link src 172.16.1.1 192.168.101.0/24 dev eth0.101 proto kernel scope link src 192.168.101.1 192.168.102.0/24 via 172.16.1.2 dev tun0 192.168.211.0/24 dev eth0.211 proto kernel scope link src 192.168.211.2 192.168.201.0/24 dev eth0.201 proto kernel scope link src 192.168.201.2 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.1 default via 192.168.201.1 dev eth0.201 |
#cat super_route
IP1=192.168.201.2 IP2=192.168.211.2 GW1=192.168.201.1 GW2=192.168.211.1 while true do if ping -I $IP1 -c 1 10.0.35.1 >& /dev/null then ip route change default via $GW1 else ping -I $IP2 -c 1 10.0.35.1 >& /dev/null && ip route change default via $GW2 fi sleep 1 done |
#cat super_route
IP1=192.168.201.2 IP2=192.168.211.2 GW1=192.168.201.1 GW2=192.168.211.1 while true do if ping -I $IP1 -c 1 10.0.35.1 >& /dev/null then ip route change default via $GW1 else ping -I $IP2 -c 1 10.0.35.1 >& /dev/null && ip route change default via $GW2 fi sleep 1 done |
IP1=192.168.201.2 IP2=192.168.211.2 GW1=192.168.201.1 GW2=192.168.211.1 while true do if ping -I $IP1 -c 1 10.0.35.1 >& /dev/null then ip route change default via $GW1 else ping -I $IP2 -c 1 10.0.35.1 >& /dev/null && ip route change default via $GW2 fi sleep 1 done
Время первой команды журнала | 20:18:42 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 21:08:57 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 18.81 | |||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 0.84 | |||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 2.01 | |||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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