/l3/users/eb/2009/linux9/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 |
|
#route delete 192.168.106.0 via 172.16.1.6 dev tun0
![]() Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [netmask N] [mss Mss] [window W] [irtt I] [mod] [dyn] [reinstate] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject inet_route [-FC] flush NOT supported |
#route del 192.168.106.0 via 172.16.1.6 dev tun0
Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [netmask N] [mss Mss] [window W] [irtt I] [mod] [dyn] [reinstate] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject inet_route [-FC] flush NOT supported |
#ifconfig eth0 0.0.0.0
|
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 dev tun0 scope link |
#/etc/init.d/openvpn stop
Stopping virtual private network daemon: server. |
#ip route
192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 |
#ip route
192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 |
#ip route
![]() e link src 192.168.15.9oute delete 192.168.15.0/24 dev eth0 proto kernel scope |
#ip route
![]() vi /etc/op openoffice/ openvpn/ opt/ |
#vi /etc/openvpn/server.conf
--- /tmp/l3-saved-30944.20088.12305 2009-06-03 18:41:03.000000000 +0300 +++ /etc/openvpn/server.conf 2009-06-03 18:41:27.000000000 +0300 @@ -2,6 +2,6 @@ proto tcp-server dev tun ifconfig 172.16.1.5 172.16.1.6 -route 192.168.106.0/24 +route 192.168.106.0/255.255.255.0 secret linux9.key |
#ping 192.168.106.1
![]() PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. From 10.0.35.1 icmp_seq=1 Time to live exceeded From 10.0.35.1 icmp_seq=2 Time to live exceeded ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 default via 192.168.205.1 dev eth0.205 |
#ping 192.168.106.1
![]() PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. From 10.0.35.1 icmp_seq=1 Time to live exceeded From 10.0.35.1 icmp_seq=2 Time to live exceeded ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms |
#ping 192.168.106.2
![]() PING 192.168.106.2 (192.168.106.2) 56(84) bytes of data. From 10.0.35.1 icmp_seq=1 Time to live exceeded From 10.0.35.1 icmp_seq=2 Time to live exceeded ^C --- 192.168.106.2 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1001ms |
#ip route
192.168.106.0 via 172.16.1.6 dev tun0 172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 default via 192.168.205.1 dev eth0.205 |
#/etc/init.d/openvpn stop
Stopping virtual private network daemon: server. |
#ip route
192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 default via 192.168.205.1 dev eth0.205 |
#ping 192.168.106.1
PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. 64 bytes from 192.168.106.1: icmp_seq=1 ttl=64 time=0.354 ms 64 bytes from 192.168.106.1: icmp_seq=2 ttl=64 time=0.310 ms ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.310/0.332/0.354/0.022 ms |
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.205.1 dev eth0.205 |
#ping 192.168.106.1
PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. 64 bytes from 192.168.106.1: icmp_seq=1 ttl=64 time=0.391 ms 64 bytes from 192.168.106.1: icmp_seq=2 ttl=64 time=0.295 ms 64 bytes from 192.168.106.1: icmp_seq=3 ttl=64 time=0.293 ms ^C --- 192.168.106.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.293/0.326/0.391/0.048 ms |
#ping 192.168.106.2
![]() PING 192.168.106.2 (192.168.106.2) 56(84) bytes of data. ^C --- 192.168.106.2 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 999ms |
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.205.1 dev eth0.205 |
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.205.1 dev eth0.205 |
#ping 192.168.106.2
PING 192.168.106.2 (192.168.106.2) 56(84) bytes of data. 64 bytes from 192.168.106.2: icmp_seq=1 ttl=63 time=0.827 ms 64 bytes from 192.168.106.2: icmp_seq=2 ttl=63 time=0.698 ms ^C --- 192.168.106.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.698/0.762/0.827/0.070 ms |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=0.233 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.229 ms 64 bytes from 10.0.35.100: icmp_seq=3 ttl=62 time=0.233 ms ^C --- 10.0.35.100 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.229/0.231/0.233/0.017 ms |
#ping ya.ru
![]() PING ya.ru (213.180.204.8) 56(84) bytes of data. ^C --- ya.ru ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2017ms |
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.205.1 dev eth0.205 |
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.205.0/24 dev eth0.205 proto kernel scope link src 192.168.205.2 192.168.105.0/24 dev eth0.105 proto kernel scope link src 192.168.105.1 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.205.1 dev eth0.205 |
#ssh 10.0.35.100
Host key fingerprint is 69:b5:3e:1a:9a:b7:c3:c3:96:03:c7:b7:b4:69:1d:3b +--[ RSA 2048]----+ | | | | | . | | o . | | .S . | | ..o.o . | | =.+o= o | | oXo=.E | | ooo* . | +-----------------+ root@10.0.35.100's password: Linux linux0 2.6.18-6-xen-686 #1 SMP Sun Feb 10 22:43:13 UTC 2008 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Jun 3 19:08:11 2009 from 192.168.204.2 l3-agent is already running: pid=4804; pidfile=/root/.lilalo/l3-agent.pid |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:59515 errors:0 dropped:0 overruns:0 frame:0 TX packets:52908 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:38042178 (36.2 MiB) TX bytes:7302214 (6.9 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:650 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:38428 (37.5 KiB) TX bytes:1092 (1.0 KiB) |
#vi /etc/openvpn/
![]() |
#vi /etc/openvpn/
![]() |
#vi /etc/openvpn/server.conf
--- /tmp/l3-saved-30944.13122.6255 2009-06-03 18:57:47.000000000 +0300 +++ /etc/openvpn/server.conf 2009-06-03 19:10:54.000000000 +0300 @@ -4,4 +4,7 @@ ifconfig 172.16.1.5 172.16.1.6 route 192.168.106.0 255.255.255.0 secret linux9.key +redirect-gateway +ping 5 +ping-restart 30 |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:59992 errors:0 dropped:0 overruns:0 frame:0 TX packets:53358 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:38086451 (36.3 MiB) TX bytes:7340379 (7.0 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link ... collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:6918 errors:0 dropped:0 overruns:0 frame:0 TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=4.58 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.232 ms ^C --- 10.0.35.100 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.232/2.406/4.581/2.175 ms |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60001 errors:0 dropped:0 overruns:0 frame:0 TX packets:53364 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:38087506 (36.3 MiB) TX bytes:7340869 (7.0 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link ... collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:6918 errors:0 dropped:0 overruns:0 frame:0 TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=0.232 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.220 ms ^C --- 10.0.35.100 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.220/0.226/0.232/0.006 ms |
#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.227 ms 64 bytes from 10.0.35.1: icmp_seq=2 ttl=63 time=0.225 ms 64 bytes from 10.0.35.1: icmp_seq=3 ttl=63 time=0.219 ms ^C --- 10.0.35.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.219/0.223/0.227/0.017 ms |
#iptables -A POSTROUTING -o eth0.205 -j MASQUERADE
iptables: No chain/target/match by that name. |
#ifconfig -a | more
|
#iptables -A POSTROUTING -o eth0.205 -j MASQUERADE
![]() iptables: No chain/target/match by that name. |
#iptables -L
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -t nat -A POSTROUTING -o eth0.205 -j MASQUERADE
|
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#vi /etc/network/interfaces
--- /tmp/l3-saved-4973.27112.10735 2009-06-03 19:53:26.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 19:57:29.000000000 +0300 @@ -1,7 +1,7 @@ # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or # /usr/share/doc/ifupdown/examples for more information. -auto lo eth0 +auto lo eth0 eth0.105 eth0.205 eth0.215 iface lo inet loopback iface eth0 inet static @@ -12,4 +12,16 @@ gateway 192.168.15.254 #vconfig add eth0.105 #ifconfig eth0.105 192.168.105.1 +iface eth0.105 +address 192.168.105.1 +network 255.255.255.0 +iface eth0.205 +address 192.168.205.2 +network 255.255.255.0 +gateway 192.168.205.1 + +iface eth0.215 +address 192.168.215.2 +network 255.255.255.0 +#gateway 192.168.215.1 |
#/etc/init.d/networking restart
Reconfiguring network interfaces.../etc/network/interfaces:15: too few parameters for iface line ifdown: couldn't read interfaces file "/etc/network/interfaces" /etc/network/interfaces:15: too few parameters for iface line ifup: couldn't read interfaces file "/etc/network/interfaces" failed. |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:64553 errors:0 dropped:0 overruns:0 frame:0 TX packets:56883 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:39024300 (37.2 MiB) TX bytes:8352823 (7.9 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:2708 (2.6 KiB) |
#ssh 192.168.205.1
![]() Connection to 192.168.205.1 closed by remote host. |
#/etc/init.d/networking restart
Reconfiguring network interfaces...if-up.d/mountnfs[eth0]: waiting for interface eth0.105 before doing NFS mounts (warning). if-up.d/mountnfs[eth0]: waiting for interface eth0.205 before doing NFS mounts (warning). if-up.d/mountnfs[eth0]: waiting for interface eth0.215 before doing NFS mounts (warning). Don't seem to be have all the variables for eth0.105/inet. Failed to bring up eth0.105. Don't seem to be have all the variables for eth0.205/inet. Failed to bring up eth0.205. Don't seem to be have all the variables for eth0.215/inet. Failed to bring up eth0.215. done. |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:66609 errors:0 dropped:0 overruns:0 frame:0 TX packets:58291 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:39253578 (37.4 MiB) TX bytes:8583343 (8.1 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:75 errors:0 dropped:0 overruns:0 frame:0 TX packets:567 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:6162 (6.0 KiB) TX bytes:79456 (77.5 KiB) |
#~ +q436f+q6b75+q6b64+q6b72+q6b6c+q2332+q2334+q2569+q2a37+q6b31
PING 192.168.215.1 (192.168.215.1) 56(84) bytes of data. 64 bytes from 192.168.215.1: icmp_seq=1 ttl=64 time=0.644 ms 64 bytes from 192.168.215.1: icmp_seq=2 ttl=64 time=0.793 ms ^C --- 192.168.215.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.644/0.718/0.793/0.079 ms |
#ping 192.168.215.2
![]() PING 192.168.215.2 (192.168.215.2) 56(84) bytes of data. ^C --- 192.168.215.2 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 1999ms |
#ifup eth0.215
Don't seem to be have all the variables for eth0.215/inet. Failed to bring up eth0.215. |
#vi /etc/network/interfaces
--- /tmp/l3-saved-4973.13961.27038 2009-06-03 20:02:27.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 20:05:27.000000000 +0300 @@ -19,7 +19,7 @@ iface eth0.205 inet static address 192.168.205.2 network 255.255.255.0 -gateway 192.168.205.1 +up ip route add default gw 192.168.205.1 table 1 ||true iface eth0.215 inet static address 192.168.215.2 |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 172.16.1.6 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.205.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.205 192.168.105.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.105 192.168.106.0 172.16.1.6 255.255.255.0 UG 0 0 0 tun0 0.0.0.0 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=0.245 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.230 ms ^C --- 10.0.35.100 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.230/0.237/0.245/0.017 ms |
#vi /etc/network/interfaces
--- /tmp/l3-saved-4973.1496.18099 2009-06-03 20:06:59.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 20:08:31.000000000 +0300 @@ -15,13 +15,17 @@ iface eth0.105 inet static address 192.168.105.1 network 255.255.255.0 +vlan_raw_device eth0 iface eth0.205 inet static address 192.168.205.2 network 255.255.255.0 up ip route add default gw 192.168.205.1 table 1 ||true +vlan_raw_device eth0 iface eth0.215 inet static address 192.168.215.2 network 255.255.255.0 +vlan_raw_device eth0 + #gateway 192.168.215.1 |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -t nat -F
|
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ifconfig eth0.215 down
|
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:72244 errors:0 dropped:0 overruns:0 frame:0 TX packets:62004 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40441025 (38.5 MiB) TX bytes:9279258 (8.8 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:353 errors:0 dropped:0 overruns:0 frame:0 TX packets:735 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:28080 (27.4 KiB) TX bytes:111724 (109.1 KiB) |
#vconfig -rem eth0.105.0
![]() Unknown command -:-rem:- Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig rem eth0.105.0
Removed VLAN -:eth0.105.0:- |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:72541 errors:0 dropped:0 overruns:0 frame:0 TX packets:62190 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40470731 (38.5 MiB) TX bytes:9315689 (8.8 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:392 errors:0 dropped:0 overruns:0 frame:0 TX packets:815 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:31244 (30.5 KiB) TX bytes:125916 (122.9 KiB) |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:72597 errors:0 dropped:0 overruns:0 frame:0 TX packets:62227 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40475831 (38.6 MiB) TX bytes:9330496 (8.8 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:399 errors:0 dropped:0 overruns:0 frame:0 TX packets:843 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:31808 (31.0 KiB) TX bytes:132780 (129.6 KiB) |
#vim /etc/network/interfaces
--- /tmp/l3-saved-6098.13929.158 2009-06-03 20:11:31.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 20:16:43.000000000 +0300 @@ -1,7 +1,8 @@ # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or # /usr/share/doc/ifupdown/examples for more information. -auto lo eth0 eth0.105 eth0.205 eth0.215 +auto lo eth0 +#eth0.105 eth0.205 eth0.215 iface lo inet loopback iface eth0 inet static @@ -14,22 +15,22 @@ #ifconfig eth0.105 192.168.105.1 -iface eth0.105 inet static -address 192.168.105.1 -network 255.255.255.0 -vlan_raw_device eth0 - - -iface eth0.205 inet static -address 192.168.205.2 -network 255.255.255.0 -up ip route add default gw 192.168.205.1 table 1 ||true -vlan_raw_device eth0 - - -iface eth0.215 inet static -address 192.168.215.2 -network 255.255.255.0 -vlan_raw_device eth0 +#iface eth0.105 inet static +#address 192.168.105.1 +#network 255.255.255.0 +#vlan_raw_device eth0 + + +#iface eth0.205 inet static +#address 192.168.205.2 +#network 255.255.255.0 +#up ip route add default gw 192.168.205.1 table 1 ||true +#vlan_raw_device eth0 + + +#iface eth0.215 inet static +#address 192.168.215.2 +#network 255.255.255.0 +#vlan_raw_device eth0 #gateway 192.168.215.1 |
#ping 192.168.202.1
PING 192.168.202.1 (192.168.202.1) 56(84) bytes of data. 64 bytes from 192.168.202.1: icmp_seq=1 ttl=64 time=0.628 ms 64 bytes from 192.168.202.1: icmp_seq=2 ttl=64 time=0.580 ms ^C --- 192.168.202.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.580/0.604/0.628/0.024 ms |
#iptables -t nat -L
Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination |
#ping 10.0.35.100
PING 10.0.35.100 (10.0.35.100) 56(84) bytes of data. 64 bytes from 10.0.35.100: icmp_seq=1 ttl=62 time=0.257 ms 64 bytes from 10.0.35.100: icmp_seq=2 ttl=62 time=0.229 ms 64 bytes from 10.0.35.100: icmp_seq=3 ttl=62 time=0.241 ms ^C --- 10.0.35.100 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.229/0.242/0.257/0.017 ms |
#ping 192.168.106.1
PING 192.168.106.1 (192.168.106.1) 56(84) bytes of data. 64 bytes from 192.168.106.1: icmp_seq=1 ttl=64 time=0.411 ms 64 bytes from 192.168.106.1: icmp_seq=2 ttl=64 time=0.396 ms ^C --- 192.168.106.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 0.396/0.403/0.411/0.021 ms |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:73091 errors:0 dropped:0 overruns:0 frame:0 TX packets:62569 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40525888 (38.6 MiB) TX bytes:9387824 (8.9 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:13 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:900 (900.0 B) TX bytes:744 (744.0 B) |
#ifconfig eth0.215 down
|
#ip route
172.16.1.6 dev tun0 proto kernel scope link src 172.16.1.5 192.168.15.0/24 dev eth0 proto kernel scope link src 192.168.15.9 192.168.106.0/24 via 172.16.1.6 dev tun0 default via 192.168.15.254 dev eth0 |
#ifup eth0.215
Don't seem to be have all the variables for eth0.215/inet. Failed to bring up eth0.215. |
#netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 172.16.1.6 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.106.0 172.16.1.6 255.255.255.0 UG 0 0 0 tun0 0.0.0.0 192.168.15.254 0.0.0.0 UG 0 0 0 eth0 |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:73302 errors:0 dropped:0 overruns:0 frame:0 TX packets:62740 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40544542 (38.6 MiB) TX bytes:9415900 (8.9 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:19 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1228 (1.1 KiB) TX bytes:744 (744.0 B) |
#vim /etc/network/interfaces
--- /tmp/l3-saved-6400.14548.14989 2009-06-03 20:14:05.000000000 +0300 +++ /etc/network/interfaces 2009-06-03 20:16:09.000000000 +0300 @@ -5,20 +5,25 @@ iface lo inet loopback iface eth0 inet static - address 192.168.15.9 - netmask 255.255.255.0 - network 192.168.15.0 - broadcast 192.168.15.255 - gateway 192.168.15.254 +# address 192.168.15.9 +# netmask 255.255.255.0 +# network 192.168.15.0 +# broadcast 192.168.15.255 +# gateway 192.168.15.254 #vconfig add eth0.105 #ifconfig eth0.105 192.168.105.1 + iface eth0.105 inet static address 192.168.105.1 network 255.255.255.0 vlan_raw_device eth0 +iface eth0.215 inet static +address 192.168.215.2 +network 255.255.255.0 +vlan_raw_device eth0 iface eth0.205 inet static address 192.168.205.2 @@ -27,9 +32,9 @@ vlan_raw_device eth0 -iface eth0.215 inet static -address 192.168.215.2 -network 255.255.255.0 -vlan_raw_device eth0 +#iface eth0.215 inet static +#address 192.168.215.2 +#network 255.255.255.0 +#vlan_raw_device eth0 #gateway 192.168.215.1 |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:74608 errors:0 dropped:0 overruns:0 frame:0 TX packets:63602 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40673136 (38.7 MiB) TX bytes:9542750 (9.1 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 BROADCAST MULTICAST MTU:1500 Metric:1 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
#ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.15.9 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::21e:8cff:fe64:2c4a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:74710 errors:0 dropped:0 overruns:0 frame:0 TX packets:63729 errors:0 dropped:0 overruns:0 carrier:2 collisions:0 txqueuelen:1000 RX bytes:40683854 (38.7 MiB) TX bytes:9558315 (9.1 MiB) eth0.105 Link encap:Ethernet HWaddr 00:1e:8c:64:2c:4a inet addr:192.168.105.1 Bcast:192.168.105.255 Mask:255.255.255.0 ... TX packets:6918 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:296793 (289.8 KiB) TX bytes:296793 (289.8 KiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:172.16.1.5 P-t-P:172.16.1.6 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
#/etc/init.d/networking restart
Reconfiguring network interfaces...Error: either "to" is duplicate, or "gw" is a garbage. if-up.d/mountnfs[eth0]: waiting for interface eth0.105 before doing NFS mounts (warning). if-up.d/mountnfs[eth0]: waiting for interface eth0.205 before doing NFS mounts (warning). if-up.d/mountnfs[eth0]: waiting for interface eth0.215 before doing NFS mounts (warning). Ignoring unknown interface eth0.105=eth0.105. Ignoring unknown interface eth0.205=eth0.205. Ignoring unknown interface eth0.215=eth0.215. done. |
#vconfig eth0 215
![]() Unknown command -:eth0:- Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig add eth0 215
![]() ERROR: trying to add VLAN #215 to IF -:eth0:- error: File exists |
#vconfig del eth0 215
![]() Unknown command -:del:- Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig add eth0 215
![]() ERROR: trying to add VLAN #215 to IF -:eth0:- error: File exists |
#vconfig delete eth0 215
![]() Unknown command -:delete:- Usage: add [interface-name] [vlan_id] rem [vlan-name] set_flag [interface-name] [flag-num] [0 | 1] set_egress_map [vlan-name] [skb_priority] [vlan_qos] set_ingress_map [vlan-name] [skb_priority] [vlan_qos] set_name_type [name-type] * The [interface-name] is the name of the ethernet card that hosts the VLAN you are talking about. * The vlan_id is the identifier (0-4095) of the VLAN you are operating on. * skb_priority is the priority in the socket buffer (sk_buff). * vlan_qos is the 3 bit priority in the VLAN header * name-type: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) * FLAGS: 1 REORDER_HDR When this is set, the VLAN device will move the ethernet header around to make it look exactly like a real ethernet device. This may help programs such as DHCPd which read the raw ethernet packet and make assumptions about the location of bytes. If you don't need it, don't turn it on, because there will be at least a small performance degradation. Default is OFF. |
#vconfig rem eth0 215
![]() ERROR: trying to remove VLAN -:eth0:- error: Invalid argument |
#vconfig rem eth0.215
Removed VLAN -:eth0.215:- |
#vconfig add eth0 215
Added VLAN with VID == 215 to IF -:eth0:- |
#ifup eth0.215
Don't seem to be have all the variables for eth0.215/inet. Failed to bring up eth0.215. |
#ifdown eth0.215
ifdown: interface eth0.215 not configured |
Время первой команды журнала | 18:36:24 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 20:21:52 2009- 6- 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 15.84 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.76 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.96 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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