/l3/users/13-02-2012/NT-Lnet/debian1.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
#cat /proc/
Display all 135 possibilities? (y or n) 1/ 148/ 19/ asound/ locks 10/ 149/ 2/ buddyinfo meminfo 1083/ 1493/ 21/ bus/ misc 11/ 1494/ 22/ cgroups modules 12/ 15/ 23/ cmdline mounts 1216/ 150/ 2364/ cpuinfo mtrr 1266/ 1503/ 238/ crypto net/ 1284/ 1504/ 24/ devices pagetypeinfo 1285/ 1591/ 25/ diskstats partitions ... 13/ 1638/ 3102 filesystems softirqs 1315/ 1679/ 4/ fs/ stat 1317/ 1680/ 400/ interrupts swaps 1319/ 169/ 5/ iomem sys/ 1362/ 17/ 6/ ioports sysrq-trigger 1363/ 1715/ 7/ irq/ sysvipc/ 1367/ 1716/ 786/ kallsyms timer_list 14/ 1717/ 798/ kcore timer_stats 1445/ 1758/ 8/ keys tty/ 1447/ 1759/ 9/ key-users uptime |
#cat /proc/net/
anycast6 ip_tables_targets rt_acct arp ipv6_route rt_cache dev mcfilter snmp dev_mcast mcfilter6 snmp6 dev_snmp6/ netfilter/ sockstat if_inet6 netlink sockstat6 igmp netstat softnet_stat igmp6 nf_conntrack stat/ ip6_flowlabel nf_conntrack_expect tcp ip6_mr_cache packet tcp6 ip6_mr_vif protocols tr_rif ip_conntrack psched udp ip_conntrack_expect ptype udp6 ip_mr_cache raw udplite ip_mr_vif raw6 udplite6 ip_tables_matches route unix ip_tables_names rt6_stats wireless |
#cat /proc/net/ip
ip6_flowlabel ip_conntrack_expect ip_tables_names ip6_mr_cache ip_mr_cache ip_tables_targets ip6_mr_vif ip_mr_vif ipv6_route ip_conntrack ip_tables_matches |
#cat /proc/net/ip
ip6_flowlabel ip_conntrack_expect ip_tables_names ip6_mr_cache ip_mr_cache ip_tables_targets ip6_mr_vif ip_mr_vif ipv6_route ip_conntrack ip_tables_matches |
#locate ip_forvard
locate: can not stat () `/var/lib/mlocate/mlocate.db': Нет такого файла или каталога |
#udpatedb
bash: udpatedb: команда не найдена |
#updatedb
|
#locate ip_forward
|
#cat /proc/sys/net/
core/ ipv6/ nf_conntrack_max unix/ ipv4/ netfilter/ token-ring/ |
#cat /proc/sys/net/ipv4/
conf/ tcp_fack icmp_echo_ignore_all tcp_fin_timeout icmp_echo_ignore_broadcasts tcp_frto icmp_errors_use_inbound_ifaddr tcp_frto_response icmp_ignore_bogus_error_responses tcp_keepalive_intvl icmp_ratelimit tcp_keepalive_probes icmp_ratemask tcp_keepalive_time igmp_max_memberships tcp_low_latency igmp_max_msf tcp_max_orphans inet_peer_gc_maxtime tcp_max_ssthresh ... inet_peer_threshold tcp_moderate_rcvbuf ip_default_ttl tcp_mtu_probing ip_dynaddr tcp_no_metrics_save ip_forward tcp_orphan_retries ipfrag_high_thresh tcp_reordering ipfrag_low_thresh tcp_retrans_collapse ipfrag_max_dist tcp_retries1 ipfrag_secret_interval tcp_retries2 ipfrag_time tcp_rfc1337 ip_local_port_range tcp_rmem |
#cat 1 > /proc/sys/net/ipv4/ip_forward
cat: 1: Нет такого файла или каталога |
#ping 192.168.64.64
PING 192.168.64.64 (192.168.64.64) 56(84) bytes of data. ^C --- 192.168.64.64 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 1999ms |
#route add -net 192.168.64.0 gw 192.168.33.2
SIOCADDRT: Недопустимый аргумент |
#route add -net 192.168.64.0/24 gw 192.168.33.2
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.240 U 0 0 0 eth1 192.168.64.0 192.168.33.2 255.255.255.0 UG 0 0 0 eth2 192.168.33.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#ping 192.168.64.64
PING 192.168.64.64 (192.168.64.64) 56(84) bytes of data. 64 bytes from 192.168.64.64: icmp_req=1 ttl=64 time=3.23 ms 64 bytes from 192.168.64.64: icmp_req=2 ttl=64 time=1.22 ms 64 bytes from 192.168.64.64: icmp_req=3 ttl=64 time=2.24 ms 64 bytes from 192.168.64.64: icmp_req=4 ttl=64 time=1.09 ms 64 bytes from 192.168.64.64: icmp_req=5 ttl=64 time=1.22 ms 64 bytes from 192.168.64.64: icmp_req=6 ttl=64 time=1.20 ms ^C --- 192.168.64.64 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5007ms rtt min/avg/max/mdev = 1.093/1.701/3.232/0.787 ms |
#route del -net 192.168.64.0/24
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.240 U 0 0 0 eth1 192.168.33.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#route add -host 192.168.64.64/24 gw 192.168.33.2
route: netmask 000000ff doesn't make sense with host route 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 add -host 192.168.64.64 gw 192.168.33.2
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.64.64 192.168.33.2 255.255.255.255 UGH 0 0 0 eth2 localnet * 255.255.255.240 U 0 0 0 eth1 192.168.33.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#ping 192.168.64.64
PING 192.168.64.64 (192.168.64.64) 56(84) bytes of data. 64 bytes from 192.168.64.64: icmp_req=1 ttl=64 time=1.30 ms 64 bytes from 192.168.64.64: icmp_req=2 ttl=64 time=1.31 ms ^C --- 192.168.64.64 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 1.306/1.312/1.319/0.036 ms |
#route del -host 192.168.64.64
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.240 U 0 0 0 eth1 192.168.33.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#ssh root@192.168.13.23
Password: Last login: Mon Feb 13 16:44:00 2012 from 192.168.13.253 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. l3-agent is already running: pid=18899; pidfile=/root/.lilalo/l3-agent.pid |
#route flush
Flushing `inet' routing table not supported 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 flush
Flushing `inet' routing table not supported 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 |
#man route
|
#route monisto default gw
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 monitor default gw
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 monitor
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) |
#man route
|
#vim /etc/network/interfaces
|
#auto lo
/sbin/route |
#ls /bin/route
ls: невозможно получить доступ к /bin/route: Нет такого файла или каталога |
#route add default gw 10.0.0.1
SIOCADDRT: Нет такого процесса |
#route add default gw 10.0.0.1/24
10.0.0.1/24: Неизвестный хост |
#route add default gw 192.168.33.2
|
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface localnet * 255.255.255.240 U 0 0 0 eth1 192.168.33.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.33.2 0.0.0.0 UG 0 0 0 eth2 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#vim /etc/sysctl.conf
--- /tmp/l3-saved-1759.15197.23179 2012-02-13 15:19:09.000000000 +0200 +++ /etc/sysctl.conf 2012-02-13 15:19:24.000000000 +0200 @@ -25,7 +25,7 @@ #net.ipv4.tcp_syncookies=1 # Uncomment the next line to enable packet forwarding for IPv4 -#net.ipv4.ip_forward=1 +net.ipv4.ip_forward=1 # Uncomment the next line to enable packet forwarding for IPv6 # Enabling this option disables Stateless Address Autoconfiguration |
#sysctl net.ipv
Display all 585 possibilities? (y or n) |
#sysctl net.ipv4.ip_forward
Display all 809 possibilities? (y or n) |
#sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1 |
#sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1 |
#sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1 |
#sysctl -a
kernel.sched_child_runs_first = 0 kernel.sched_min_granularity_ns = 1000000 kernel.sched_latency_ns = 5000000 kernel.sched_wakeup_granularity_ns = 1000000 kernel.sched_shares_ratelimit = 250000 kernel.sched_shares_thresh = 4 kernel.sched_features = 32611451 kernel.sched_migration_cost = 500000 kernel.sched_nr_migrate = 32 kernel.sched_time_avg = 1000 ... net.ipv6.route.mtu_expires = 600 net.ipv6.route.min_adv_mss = 4 net.ipv6.route.gc_min_interval_ms = 500 net.ipv6.icmp.ratelimit = 1000 net.ipv6.bindv6only = 0 net.ipv6.ip6frag_secret_interval = 600 net.ipv6.mld_max_msf = 64 net.nf_conntrack_max = 32172 net.unix.max_dgram_qlen = 10 crypto.fips_enabled = 0 |
#sysctl -a|grep forward
error: "Success" reading key "dev.parport.parport0.autoprobe" error: "Success" reading key "dev.parport.parport0.autoprobe0" error: "Success" reading key "dev.parport.parport0.autoprobe1" error: "Success" reading key "dev.parport.parport0.autoprobe2" error: "Success" reading key "dev.parport.parport0.autoprobe3" error: permission denied on key 'net.ipv4.route.flush' net.ipv4.conf.all.forwarding = 1 net.ipv4.conf.all.mc_forwarding = 0 net.ipv4.conf.default.forwarding = 1 net.ipv4.conf.default.mc_forwarding = 0 ... net.ipv6.conf.default.mc_forwarding = 0 net.ipv6.conf.lo.forwarding = 0 net.ipv6.conf.lo.mc_forwarding = 0 net.ipv6.conf.eth0.forwarding = 0 net.ipv6.conf.eth0.mc_forwarding = 0 net.ipv6.conf.eth1.forwarding = 0 net.ipv6.conf.eth1.mc_forwarding = 0 net.ipv6.conf.eth2.forwarding = 0 net.ipv6.conf.eth2.mc_forwarding = 0 error: permission denied on key 'net.ipv6.route.flush' |
#ssh root@192.168.13.253
9 disk = [ 'phy:/dev/tom0/debian2,hda,w' ] 10 acpi=1 11 apic=0 12 device_model = '/usr/lib/xen/bin/qemu-dm' "xen/debian2" 21L, 436C 13 boot='c' 14 sdl=0 15 vnc=1 16 vncpasswd='' 17 stdvga=0 ... 17 stdvga=0 18 serial='pty' 19 usb=1 20 usbdevice='tablet' 21 localtime=0 ~ "xen/debian3" 21L, 436C записано fobos:~# exit logout Connection to 192.168.13.253 closed. |
#. /etc/netstart
devd already running? (pid=751). Setting hostuuid: a675e116-d753-774a-e67e-2adb8a64c1d9. Setting hostid: 0x4f43d0e9. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:00:03 inet 192.168.13.23 netmask 0xffffff00 broadcast 192.168.13.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active add net default: gateway 192.168.13.253 Additional routing options:. Connection to 192.168.13.23 closed. |
#vim /etc/netstart
|
#{_start}
font8x16="cp866b-8x16" font8x8="cp866-8x8" hostname="freebsd3.net.nt" ifconfig_re0="inet 192.168.13.23 netmask 255.255.255.0" inetd_enable="YES", 583C ifconfig_re1="inet 10.0.0.1 netmask 255.255.0.0" keymap="ru.koi8-r" mousechar_start="3" saver="daemon" ~ ~ ~ "/etc/rc.conf" 19L, 632C written |
#scp root@192.168.13.253:/root/route_for_lab .
root@192.168.13.253's password: route_for_lab 100% 163 0.2KB/s 00:00 |
#. /etc/netstart
devd already running? (pid=751). Setting hostuuid: a675e116-d753-774a-e67e-2adb8a64c1d9. Setting hostid: 0x4f43d0e9. lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:00:03 ... status: active re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:01:03 inet 10.0.0.1 netmask 0xffff0000 broadcast 10.0.255.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active add net default: gateway 192.168.13.253 Additional routing options:. Connection to 192.168.13.23 closed. |
#ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:00:03 inet 192.168.13.23 netmask 0xffffff00 broadcast 192.168.13.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:01:03 inet 10.0.0.1 netmask 0xffff0000 broadcast 10.0.255.255 ... re2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:02:03 media: Ethernet autoselect (100baseTX <full-duplex>) status: active plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 |
#ifconig re1 192.168.1.1 netmask 0xffff0000
bash: ifconig: command not found |
#vim /etc/network/interfaces
--- /tmp/l3-saved-1336.32257.8864 2012-02-13 16:03:53.000000000 +0200 +++ /etc/network/interfaces 2012-02-13 16:05:26.000000000 +0200 @@ -7,3 +7,8 @@ netmask 255.255.255.0 gateway 192.168.13.253 +auto eth2 +iface eth2 inet static + address 192.168.641 + netmask 255.255.255.0 + |
#ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:00:03 inet 192.168.13.23 netmask 0xffffff00 broadcast 192.168.13.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:01:03 inet 192.168.1.1 netmask 0xffff0000 broadcast 192.168.255.255 ... re2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:16:4e:00:02:03 media: Ethernet autoselect (100baseTX <full-duplex>) status: active plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 |
#if
if ifconfig ifmcstat ifnames ifnames-2.68 |
#if
if ifconfig ifmcstat ifnames ifnames-2.68 |
#exit
exit Connection to 192.168.13.23 closed. |
#ssh root@debian3.net.nt
ssh: Could not resolve hostname debian3.net.nt: Name or service not known |
#ssh root@192.168.13.3
The authenticity of host '192.168.13.3 (192.168.13.3)' can't be established. RSA key fingerprint is 3e:c3:8c:6f:e8:92:5b:31:dd:04:d2:51:48:57:c9:99. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.13.3' (RSA) to the list of known hosts. root@192.168.13.3's password: Linux debian3 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 UTC 2011 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: Tue Dec 13 08:57:58 2011 from fobos.net.nt Removing stale pidfile l3-agent is already running: pid=1359; pidfile=/root/.lilalo/l3-agent.pid |
#vim /etc/network/interfaces
|
#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). Reconfiguring network interfaces...done. |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:00:00:03 inet addr:192.168.13.3 Bcast:192.168.13.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:3/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:480 errors:0 dropped:0 overruns:0 frame:0 TX packets:271 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:38928 (38.0 KiB) TX bytes:36819 (35.9 KiB) Interrupt:5 Base address:0x8000 eth1 Link encap:Ethernet HWaddr 00:16:3e:00:01:03 ... RX bytes:0 (0.0 B) TX bytes:328 (328.0 B) Interrupt:10 Base address:0xa100 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.168.0 * 255.255.255.0 U 0 0 0 eth1 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.168.1 0.0.0.0 UG 0 0 0 eth1 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#exit
exit Connection to 192.168.13.3 closed. |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.64.0 debian1.net.nt 255.255.255.0 UG 0 0 0 eth0 192.168.2.0 * 255.255.255.0 U 0 0 0 eth2 192.168.0.0 debian1.net.nt 255.255.255.0 UG 0 0 0 eth0 192.168.168.0 debian1.net.nt 255.255.255.0 UG 0 0 0 eth0 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#vim /etc/network/interfaces
--- /tmp/l3-saved-1740.26210.14338 2012-02-13 16:09:30.000000000 +0200 +++ /etc/network/interfaces 2012-02-13 16:09:56.000000000 +0200 @@ -12,6 +12,6 @@ address 192.168.641 netmask 255.255.255.0 -up route add -net 192.168.64.0/24 gw 192.168.13.1 -up route add -net 192.168.0.0/24 gw 192.168.13.1 -up route add -net 192.168.168.0/24 gw 192.168.13.1 +up route add -net 192.168.64.0/24 gw 192.168.64.150 +up route add -net 192.168.0.0/24 gw 192.168.64.150 +up route add -net 192.168.168.0/24 gw 192.168.64.150 |
#netstat
Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 freebsd3.ssh 192.168.13.253.48317 ESTABLISHED Active UNIX domain sockets Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr c3423d20 stream 0 0 c3478450 0 0 0 /var/run/devd.pipe c34232a0 dgram 0 0 0 c34235e8 0 c34233f0 c3423348 dgram 0 0 0 c3423690 0 0 c34233f0 dgram 0 0 0 c34235e8 0 0 c34235e8 dgram 0 0 c348dbdc 0 c34232a0 0 /var/run/logpriv c3423690 dgram 0 0 c348dcf0 0 c3423348 0 /var/run/log |
#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). Reconfiguring network interfaces...SIOCADDRT: No such process Failed to bring up eth2. done. |
#netstat
Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 freebsd3.ssh 192.168.13.253.48317 ESTABLISHED Active UNIX domain sockets Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr c3423d20 stream 0 0 c3478450 0 0 0 /var/run/devd.pipe c34232a0 dgram 0 0 0 c34235e8 0 c34233f0 c3423348 dgram 0 0 0 c3423690 0 0 c34233f0 dgram 0 0 0 c34235e8 0 0 c34235e8 dgram 0 0 c348dbdc 0 c34232a0 0 /var/run/logpriv c3423690 dgram 0 0 c348dcf0 0 c3423348 0 /var/run/log |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 * 255.255.255.0 U 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#ping 192.168.64.150
PING 192.168.64.150 (192.168.64.150) 56(84) bytes of data. ^C --- 192.168.64.150 ping statistics --- 20 packets transmitted, 0 received, 100% packet loss, time 18999ms |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:00:00:01 inet addr:192.168.13.1 Bcast:192.168.13.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2415 errors:0 dropped:0 overruns:0 frame:0 TX packets:1842 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:222951 (217.7 KiB) TX bytes:234950 (229.4 KiB) Interrupt:5 Base address:0xe000 eth2 Link encap:Ethernet HWaddr 00:16:3e:00:02:01 ... RX bytes:0 (0.0 B) TX bytes:936 (936.0 B) Interrupt:11 Base address:0x2200 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) |
#vim /etc/network/interfaces
--- /tmp/l3-saved-1740.11853.31185 2012-02-13 16:10:51.000000000 +0200 +++ /etc/network/interfaces 2012-02-13 16:11:00.000000000 +0200 @@ -9,7 +9,7 @@ auto eth2 iface eth2 inet static - address 192.168.641 + address 192.168.64.1 netmask 255.255.255.0 up route add -net 192.168.64.0/24 gw 192.168.64.150 |
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3e:00:00:01 inet addr:192.168.13.1 Bcast:192.168.13.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2580 errors:0 dropped:0 overruns:0 frame:0 TX packets:1965 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:236512 (230.9 KiB) TX bytes:253056 (247.1 KiB) Interrupt:5 Base address:0xe000 eth2 Link encap:Ethernet HWaddr 00:16:3e:00:02:01 ... RX bytes:712 (712.0 B) TX bytes:1272 (1.2 KiB) Interrupt:11 Base address:0x2200 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:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) |
#route
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.64.0 192.168.64.150 255.255.255.0 UG 0 0 0 eth2 192.168.64.0 * 255.255.255.0 U 0 0 0 eth2 192.168.0.0 192.168.64.150 255.255.255.0 UG 0 0 0 eth2 192.168.168.0 192.168.64.150 255.255.255.0 UG 0 0 0 eth2 192.168.13.0 * 255.255.255.0 U 0 0 0 eth0 default 192.168.13.253 0.0.0.0 UG 0 0 0 eth0 |
#screen
|
#exit
no exit |
#vim /etc/network/interfaces
--- /tmp/l3-saved-2147.31046.30858 2012-02-13 16:12:27.000000000 +0200 +++ /etc/network/interfaces 2012-02-13 16:15:53.000000000 +0200 @@ -12,6 +12,6 @@ address 192.168.64.1 netmask 255.255.255.0 -up route add -net 192.168.64.0/24 gw 192.168.64.150 up route add -net 192.168.0.0/24 gw 192.168.64.150 up route add -net 192.168.168.0/24 gw 192.168.64.150 +up route add -net 192.168.16.0/24 gw 192.168.64.150 |
#echo 1 > /proc/sys/net/ipv4/ip_forward
|
#vim /etc/sysctl.conf
|
#ssh root@192.168.13.3
root@192.168.13.3's password: Linux debian3 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 UTC 2011 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: Mon Feb 13 16:07:12 2012 from 192.168.13.253 l3-agent is already running: pid=1359; pidfile=/root/.lilalo/l3-agent.pid l3-agent is already running: pid=1359; pidfile=/root/.lilalo/l3-agent.pid |
#sysctl net.ipv
Display all 563 possibilities? (y or n) |
#sysctl net.ipv4.
Display all 304 possibilities? (y or n) |
#sysctl net.ipv4.ip_forward
Display all 760 possibilities? (y or n) |
#sysctl net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1 |
#vim /etc/sysctl.conf
|
#exit
exit Connection to 192.168.13.3 closed. |
#ssh root@192.168.13.2
The authenticity of host '192.168.13.2 (192.168.13.2)' can't be established. RSA key fingerprint is 3e:c3:8c:6f:e8:92:5b:31:dd:04:d2:51:48:57:c9:99. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.13.2' (RSA) to the list of known hosts. root@192.168.13.2's password: Linux debian2 2.6.32-5-686 #1 SMP Fri Sep 9 20:51:05 UTC 2011 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: Mon Feb 13 15:54:20 2012 from 192.168.13.253 l3-agent is already running: pid=1348; pidfile=/root/.lilalo/l3-agent.pid l3-agent is already running: pid=1348; pidfile=/root/.lilalo/l3-agent.pid |
#exit
exit Connection to 192.168.13.2 closed. |
#ssh root@192.168.13.21
The authenticity of host '192.168.13.21 (192.168.13.21)' can't be established. DSA key fingerprint is 0a:54:02:23:35:67:a7:44:31:e7:ae:ec:12:e3:bb:31. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.13.21' (DSA) to the list of known hosts. Password: Last login: Mon Feb 13 17:54:29 2012 from 192.168.13.253 Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 7.4-RELEASE (GENERIC) #1: Sun Feb 12 15:17:17 EET 2012 Welcome to FreeBSD! ... http://www.FreeBSD.org/search/. If the doc distribution has been installed, they're also available formatted in /usr/share/doc. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the questions@FreeBSD.org mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. Removing stale pidfile |
#vim /etc/network/interfaces
|
#reboot
Broadcast message from root@debian3 (pts/1) (Mon Feb 13 16:29:30 2012): The system is going down for reboot NOW! |
#cat /proc/sys/net/ipv4/ip_forward
1 |
Display all 135 possibilities? (y or n) 1/ 148/ 19/ asound/ locks 10/ 149/ 2/ buddyinfo meminfo 1083/ 1493/ 21/ bus/ misc 11/ 1494/ 22/ cgroups modules 12/ 15/ 23/ cmdline mounts 1216/ 150/ 2364/ cpuinfo mtrr 1266/ 1503/ 238/ crypto net/ 1284/ 1504/ 24/ devices pagetypeinfo 1285/ 1591/ 25/ diskstats partitions 1286/ 1592/ 26/ dma sched_debug 1287/ 16/ 3/ driver/ scsi/ 1288/ 1629/ 3099 execdomains self/ 1289/ 1637/ 3100 fb slabinfo 13/ 1638/ 3102 filesystems softirqs 1315/ 1679/ 4/ fs/ stat 1317/ 1680/ 400/ interrupts swaps 1319/ 169/ 5/ iomem sys/ 1362/ 17/ 6/ ioports sysrq-trigger 1363/ 1715/ 7/ irq/ sysvipc/ 1367/ 1716/ 786/ kallsyms timer_list 14/ 1717/ 798/ kcore timer_stats 1445/ 1758/ 8/ keys tty/ 1447/ 1759/ 9/ key-users uptime
anycast6 ip_tables_targets rt_acct arp ipv6_route rt_cache dev mcfilter snmp dev_mcast mcfilter6 snmp6 dev_snmp6/ netfilter/ sockstat if_inet6 netlink sockstat6 igmp netstat softnet_stat igmp6 nf_conntrack stat/ ip6_flowlabel nf_conntrack_expect tcp ip6_mr_cache packet tcp6 ip6_mr_vif protocols tr_rif ip_conntrack psched udp ip_conntrack_expect ptype udp6 ip_mr_cache raw udplite ip_mr_vif raw6 udplite6 ip_tables_matches route unix ip_tables_names rt6_stats wireless
ip6_flowlabel ip_conntrack_expect ip_tables_names ip6_mr_cache ip_mr_cache ip_tables_targets ip6_mr_vif ip_mr_vif ipv6_route ip_conntrack ip_tables_matches
1
Время первой команды журнала | 13:52:42 2012- 2-13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:29:34 2012- 2-13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 16.83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 1.03 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 1.63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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