| /l3/users/27-07-2009/nt-lnet/debian7.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 :18 |
|
|
#[root@fbsd4:~]# route add -net 192.168.54.32 255.255.255.224 192.168.54.30
[root@fbsd4:~]# /etc/netstart
devd already running? (pid=705).
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> 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> mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
inet 192.168.16.24 netmask 0xffffff00 broadcast 192.168.16.255
ether 00:16:4e:00:00:04
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
add net default: gateway 192.168.16.254
Additional routing options:.
|
|
#[root@fbsd4:~]# netstat -rn -f inet
Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.16.254 UGS 0 11 re0 127.0.0.1 127.0.0.1 UH 0 0 lo0 192.168.16 link#1 UC 0 0 re0 192.168.16.7 00:16:3e:00:00:07 UHLW 1 18 re0 1197 192.168.16.254 00:04:75:75:46:b1 UHLW 2 2 re0 1198 192.168.54/27 link#2 UC 0 0 re1 192.168.54.30 link#2 UHLW 2 0 re1 192.168.54.32/27 192.168.54.30 UGS 0 0 re1 |
|
#[root@fbsd4:~]# sh /etc/rc.d/routed
[root@fbsd4:~]# sh /etc/rc.d/rout route6d routed routing Usage: /etc/rc.d/routed [fast|force|one](start|stop|restart|rcvar|status|poll) |
|
#[root@fbsd4:~]# sh /etc/rc.d/routed restart
|
|
#[root@fbsd4:~]# netstat -rn -f inet
Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.16.254 UGS 0 26 re0 127.0.0.1 127.0.0.1 UH 0 0 lo0 192.168.16 link#1 UC 0 0 re0 192.168.16.7 00:16:3e:00:00:07 UHLW 1 89 re0 1143 192.168.16.254 00:04:75:75:46:b1 UHLW 2 5 re0 1191 192.168.54/27 link#2 UC 0 0 re1 192.168.54.30 link#2 UHLW 2 0 re1 192.168.54.32/27 192.168.54.30 UGS 0 0 re1 |
|
#[root@fbsd4:~]# netstat -rn -f inet
[root@fbsd4:~]# sh /etc/rc.d/routing restart default 192.168.16.254 done 192.168.54.32 192.168.54.30 done add net default: gateway 192.168.16.254 Additional routing options:. Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.16.254 UGS 0 6 re0 127.0.0.1 127.0.0.1 UH 0 0 lo0 192.168.16 link#1 UC 0 0 re0 192.168.16.7 00:16:3e:00:00:07 UHLW 1 122 re0 1134 192.168.16.254 00:04:75:75:46:b1 UHLW 2 6 re0 1194 192.168.54/27 link#2 UC 0 0 re1 192.168.54.30 link#2 UHLW 1 0 re1 |
|
#[root@fbsd4:~]# route add -net 192.168.54.64/27 192.168.54.30
[root@fbsd4:~]# route add -net 192.168.54.32/27 192.168.54.30 add net 192.168.54.32: gateway 192.168.54.30 add net 192.168.54.64: gateway 192.168.54.30 |
|
#[root@fbsd4:~]# route add -net 192.168.54.96/27 192.168.54.30
add net 192.168.54.96: gateway 192.168.54.30 |
|
#[root@fbsd4:~]# netstat -rn -f inet
[root@fbsd4:~]# route add -net 192.168.54.128/27 192.168.54.30 add net 192.168.54.128: gateway 192.168.54.30 Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.16.254 UGS 0 26 re0 127.0.0.1 127.0.0.1 UH 0 0 lo0 192.168.16 link#1 UC 0 0 re0 192.168.16.7 00:16:3e:00:00:07 UHLW 1 219 re0 1079 192.168.16.254 00:04:75:75:46:b1 UHLW 2 10 re0 1185 192.168.54/27 link#2 UC 0 0 re1 192.168.54.30 link#2 UHLW 5 0 re1 192.168.54.32/27 192.168.54.30 UGS 0 0 re1 192.168.54.64/27 192.168.54.30 UGS 0 0 re1 192.168.54.96/27 192.168.54.30 UGS 0 0 re1 192.168.54.128/27 192.168.54.30 UGS 0 0 re1 |
|
#[root@fbsd4:~]# vim /etc/sysctl.conf
# $FreeBSD: src/etc/sysctl.conf,v 1.8 2003/03/13 18:43:50 mux Exp $ # # This file is read when going to multi-user and its contents piped thru # ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "/etc/sysctl.conf" 11 lines, 415 characters |
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]# exit
exit Connection to 192.168.16.24 closed. |
|
$ssh 192.168.16.
The authenticity of host '192.168.16.4 (192.168.16.4)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). root@192.168.16.4's password: Last login: Wed Jul 29 21:44:37 2009 from debian.net.nt Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 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. l3-agent is already running: pid=1430; pidfile=/root/.lilalo/l3-agent.pid |
|
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:04
inet addr:192.168.16.4 Bcast:192.168.16.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe00:4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:68915 errors:0 dropped:0 overruns:0 frame:0
TX packets:59672 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23533118 (22.4 MiB) TX bytes:11016110 (10.5 MiB)
|
|
#ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:04
inet addr:192.168.54.30 Bcast:192.168.54.31 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:104/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:360 (360.0 b) TX bytes:510 (510.0 b)
|
|
#ifconfig eth3
eth3: error fetching interface information: Device not found |
|
#ifconfig eth2
eth2 Link encap:Ethernet HWaddr 00:16:3E:00:02:04
inet addr:192.168.54.33 Bcast:192.168.54.63 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:204/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:152 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10258 (10.0 KiB) TX bytes:2010 (1.9 KiB)
|
|
#cat /proc/sys/net/ipv4/ip_forward
1 |
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.0 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.32 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.54.64 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.96 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.16.254 0.0.0.0 UG 0 0 0 eth0 |
|
#route delete default
|
|
#route add default gw 192.168.54.1
|
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.0 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.32 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.54.64 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.96 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.1 0.0.0.0 UG 0 0 0 eth1 |
|
#exit
exit Connection to 192.168.16.4 closed. |
|
$ssh 192.168.16.5
The authenticity of host '192.168.16.5 (192.168.16.5)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). root@192.168.16.5's password: Last login: Wed Jul 29 21:43:00 2009 from debian.net.nt Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 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. l3-agent is already running: pid=1590; pidfile=/root/.lilalo/l3-agent.pid |
|
#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:05
inet addr:192.168.16.5 Bcast:192.168.16.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe00:5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:100873 errors:0 dropped:0 overruns:0 frame:0
TX packets:56136 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30628459 (29.2 MiB) TX bytes:7753554 (7.3 MiB)
|
|
#ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:05
inet addr:192.168.54.65 Bcast:192.168.54.95 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:105/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:211 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13628 (13.3 KiB) TX bytes:6508 (6.3 KiB)
|
|
#ifconfig eth2
eth2 Link encap:Ethernet HWaddr 00:16:3E:00:02:05
inet addr:192.168.54.62 Bcast:192.168.54.63 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:205/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62 errors:0 dropped:0 overruns:0 frame:0
TX packets:214 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4260 (4.1 KiB) TX bytes:13680 (13.3 KiB)
|
|
#cat /proc/sys
sys/ sysrq-trigger sysvipc/ |
|
#cat /proc/sys/net/ipv4/ip_forward
1 |
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.94 255.255.255.224 UG 0 0 0 eth1 192.168.54.32 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 192.168.54.94 255.255.255.224 UG 0 0 0 eth1 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.33 0.0.0.0 UG 0 0 0 eth2 |
|
#exit
exit Connection to 192.168.16.5 closed. |
|
#ifconfig eth0
[user@debian7:~]$ ssh 192.168.16.6 The authenticity of host '192.168.16.6 (192.168.16.6)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). root@192.168.16.6's password: Last login: Wed Jul 29 21:44:42 2009 from debian.net.nt Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the ... permitted by applicable law. l3-agent is already running: pid=1415; pidfile=/root/.lilalo/l3-agent.pid eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:06 inet addr:192.168.16.6 Bcast:192.168.16.255 Mask:255.255.255.0 inet6 addr: fe80::216:3eff:fe00:6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8199 errors:0 dropped:0 overruns:0 frame:0 TX packets:11120 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:883605 (862.8 KiB) TX bytes:2324931 (2.2 MiB) |
|
#ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:06
inet addr:192.168.54.94 Bcast:192.168.54.95 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:106/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:104 errors:0 dropped:0 overruns:0 frame:0
TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7786 (7.6 KiB) TX bytes:15022 (14.6 KiB)
|
|
#ifconfig eth2
eth2 Link encap:Ethernet HWaddr 00:16:3E:00:02:06
inet addr:192.168.54.97 Bcast:192.168.54.127 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:206/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:149 errors:0 dropped:0 overruns:0 frame:0
TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9106 (8.8 KiB) TX bytes:4432 (4.3 KiB)
|
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.126 255.255.255.224 UG 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.65 0.0.0.0 UG 0 0 0 eth1 |
|
#exit
exit Connection to 192.168.16.6 closed. |
|
$ssh 192.168.16.25
The authenticity of host '192.168.16.25 (192.168.16.25)' can't be established.
DSA key fingerprint is 13:3f:fb:2a:53:62:8e:f8:0e:c7:3a:c9:10:99:b6:25.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts).
Password:
Last login: Fri Jul 31 15:17:43 2009
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008
Welcome to FreeBSD!
...
along with the mailing lists, can be searched by going to
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.
|
|
$ssh 192.168.16.26
[root@fbsd5:~]# exit exit Connection to 192.168.16.25 closed. The authenticity of host '192.168.16.26 (192.168.16.26)' can't be established. DSA key fingerprint is 13:3f:fb:2a:53:62:8e:f8:0e:c7:3a:c9:10:99:b6:25. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). Password: Last login: Fri Jul 24 17:34:52 2009 from debian.net.nt Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994 ... along with the mailing lists, can be searched by going to 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. |
|
#[root@fbsd6:~]#
[root@fbsd6:~]# |
|
#[root@fbsd6:~]#
|
|
#[root@fbsd6:~]# ifconfig re0
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
inet 192.168.16.26 netmask 0xffffff00 broadcast 192.168.16.255
ether 00:16:4e:00:00:06
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
|
|
#[root@fbsd6:~]# netstat -rn
[root@fbsd6:~]# ifconfig re1
re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
inet 192.168.54.158 netmask 0xffffffe0 broadcast 192.168.54.159
ether 00:16:4e:00:01:06
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
...
192.168.16.254 00:04:75:75:46:b1 UHLW 1 13 re0 1183
192.168.54.128/27 link#2 UC 0 0 re1
192.168.54.129 00:16:4e:00:01:05 UHLW 2 0 re1 1134
Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UHL lo0
fe80::%lo0/64 fe80::1%lo0 U lo0
fe80::1%lo0 link#5 UHL lo0
ff01:5::/32 fe80::1%lo0 UC lo0
ff02::%lo0/32 fe80::1%lo0 UC lo0
|
|
#[root@fbsd6:~]# ping ya.ru
[root@fbsd6:~]# ping ya.ru PING ya.ru (77.88.21.8): 56 data bytes 36 bytes from 192.168.54.129: Destination Host Unreachable Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 5400 58d1 0 0000 40 01 c831 192.168.54.158 77.88.21.8 ^C --- ya.ru ping statistics --- 7 packets transmitted, 0 packets received, 100% packet loss õ ×ÁÓ ÅÓÔØ ÎÏ×ÁÑ ÐÏÞÔÁ × /var/mail/root PING ya.ru (213.180.204.8): 56 data bytes ^C --- ya.ru ping statistics --- 4 packets transmitted, 0 packets received, 100% packet loss |
|
#[root@fbsd6:~]# exit
[root@fbsd6:~]# traceroute -n ya.ru traceroute: Warning: ya.ru has multiple addresses; using 77.88.21.8 traceroute to ya.ru (77.88.21.8), 64 hops max, 40 byte packets 1 192.168.54.129 1.534 ms 2.634 ms 0.872 ms 2 192.168.54.97 2.583 ms 1.813 ms 1.702 ms 3 192.168.54.65 2.923 ms 1.497 ms 1.114 ms 4 192.168.54.33 2.492 ms 1.976 ms 1.626 ms 5 192.168.54.1 2.928 ms 2.220 ms 1.908 ms 6 * *^C exit Connection to 192.168.16.26 closed. |
|
$ssh 192.168.16.254
7
8 # Uncomment the following to stop low-level messages on console
9 #kernel.printk = 4 4 1 7
10
r)############################################################3
16 # Turn on Source Address Verification in all interfaces to
"/etc/sysctl.conf" 68L, 2283C
17 # prevent some spoofing attacks
18 #net.ipv4.conf.default.rp_filter=1
19 #net.ipv4.conf.all.rp_filter=1 to enable Spoof protection (reverse-path filtee
20
21 # Uncomment the next line to enable TCP/IP SYN cookies
|
|
$ssh 192.168.16.24
The authenticity of host '192.168.16.24 (192.168.16.24)' can't be established.
DSA key fingerprint is 13:3f:fb:2a:53:62:8e:f8:0e:c7:3a:c9:10:99:b6:25.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts).
Password:
Last login: Fri Jul 31 18:41:09 2009 from 192.168.16.7
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 6.3-RELEASE (SMP) #0: Wed Jan 16 04:45:45 UTC 2008
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
|
|
#[root@fbsd4:~]# grep route /etc/defaults/rc.conf | less
|
|
#[root@fbsd4:~]# grep route /etc/defaults/rc.conf | less
|
|
#[root@fbsd4:~]# vim /etc/rc.conf
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/rc.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.rc.conf.swp"
to avoid this message.
Swap file "/etc/.rc.conf.swp" already exists!
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]# vim /etc/rc.conf
"/etc/rc.conf" 21 lines, 621 characters written õ ×ÁÓ ÅÓÔØ ÎÏ×ÁÑ ÐÏÞÔÁ × /var/mail/root |
|
#[root@fbsd4:~]#
[root@fbsd4:~]# mail Mail version 8.1 6/6/93. Type ? for help. "/var/mail/root": 708 messages 691 new 708 unread U 1 root@fbsdvm.unix.nt Fri Jul 24 16:20 24/938 "Cron <root@fbsdvm> " U 2 root@fbsdvm.unix.nt Fri Jul 24 16:30 24/936 "Cron <root@fbsdvm> " U 3 root@fbsdvm.unix.nt Fri Jul 24 16:40 24/936 "Cron <root@fbsdvm> " U 4 root@fbsdvm.unix.nt Fri Jul 24 16:50 24/936 "Cron <root@fbsdvm> " U 5 root@fbsdvm.unix.nt Fri Jul 24 17:00 24/936 "Cron <root@fbsdvm> " U 6 root@fbsdvm.unix.nt Fri Jul 24 17:10 24/936 "Cron <root@fbsdvm> " U 7 root@fbsdvm.unix.nt Fri Jul 24 17:20 24/936 "Cron <root@fbsdvm> " ... Subject: Cron <root@fbsdvm> ntpdate ntp.psn.ru X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin> X-Cron-Env: <HOME=/var/log> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> 24 Jul 19:40:23 ntpdate[959]: adjust time server 194.149.67.130 offset 0.047718 sec & q Saved 1 message in mbox Held 707 messages in /var/mail/root |
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]# cat /etc/rc.conf
sshd_enable="yes" font8x14="cp866-8x14" font8x16="cp866b-8x16" font8x8="cp866-8x8" keymap="ru.koi8-r" keyrate="normal" local_startup="/usr/local/etc/rc.d" mousechar_start="3" moused_enable="YES" saver="fire" scrnmap="koi8-r2cp866" usbd_enable="YES" inetd_enable=yes defaultrouter="192.168.16.254" ifconfig_re0="inet 192.168.16.24 netmask 255.255.255.0" hostname="fbsd4.net.nt" static_routes="54_32 54_64 54_96 54_128" route_54_32="-net 192.168.54.32/27 192.168.54.30" route_54_64="-net 192.168.54.64/27 192.168.54.30" route_54_96="-net 192.168.54.96/27 192.168.54.30" route_54_128="-net 192.168.54.128/27 192.168.54.30" |
|
#[root@fbsd4:~]# /etc/rc.d/routing restart
[root@fbsd4:~]# netstat -rn -f inet > /tmp/before default 192.168.16.254 done 192.168.54.32 192.168.54.30 done 192.168.54.64 192.168.54.30 done 192.168.54.96 192.168.54.30 done 192.168.54.128 192.168.54.30 done add net default: gateway 192.168.16.254 add net 192.168.54.32: gateway 192.168.54.30 add net 192.168.54.64: gateway 192.168.54.30 add net 192.168.54.96: gateway 192.168.54.30 add net 192.168.54.128: gateway 192.168.54.30 Additional routing options:. |
|
#[root@fbsd4:~]# vimdiff /tmp/after /tmp/before
192.168.16 link#1
Flags Refs Use Netif Expire
default 192.168.16.254 UGS 0 1684 re0
UH 0 96 lo0
192.168.16.204 00:16:35:7d:81:ee UC 0 0 re0
192.168.16.7 00:16:3e:00:00:07 UHLW 1 1107 re0 745
192.168.16.204 00:16:35:7d:81:ee UHLW 1 5459 re0 193
192.168.16.254 00:04:75:75:46:b1 UHLW 2 75 re0 1175
192.168.54/27 link#2 UC 0 0 re1
"/192.168.54.30 00:16:3e:00:01:04 UHLW 5 0 re1 1189
...
192.168.54.96/27 192.168.54.30 UGS 0 6 re1
192.168.54.128/27 192.168.54.30 UGS 0 772 re1
~
~
~
~
~
~
~
õ ×ÁÓ ÅÓÔØ ÐÏÞÔÁ × /var/mail/root
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]#
|
|
#[root@fbsd4:~]# /etc/netstart restart
[root@fbsd4:~]# netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.16.254 UGS 0 48 re0 127.0.0.1 127.0.0.1 UH 0 96 lo0 192.168.16 link#1 UC 0 0 re0 192.168.16.7 00:16:3e:00:00:07 UHLW 1 1235 re0 692 192.168.16.204 00:16:35:7d:81:ee UHLW 1 5459 re0 140 192.168.16.254 00:04:75:75:46:b1 UHLW 2 79 re0 1163 ... add net default: gateway 192.168.16.254 route: writing to routing socket: File exists add net 192.168.54.32: gateway 192.168.54.30: route already in table route: writing to routing socket: File exists add net 192.168.54.64: gateway 192.168.54.30: route already in table route: writing to routing socket: File exists add net 192.168.54.96: gateway 192.168.54.30: route already in table route: writing to routing socket: File exists add net 192.168.54.128: gateway 192.168.54.30: route already in table Additional routing options:. |
|
#[root@fbsd4:~]# reboot
[root@fbsd4:~]# cat /etc/sysctl.conf # $FreeBSD: src/etc/sysctl.conf,v 1.8 2003/03/13 18:43:50 mux Exp $ # # This file is read when going to multi-user and its contents piped thru # ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. # # Uncomment this to prevent users from seeing information about processes that # are being run under another UID. #security.bsd.see_other_uids=0 net.inet6.ip6.v6only=0 net.inet.ip.forwarding=1 Connection to 192.168.16.24 closed by remote host. Connection to 192.168.16.24 closed. |
|
$ping 192.168.16.24
PING 192.168.16.24 (192.168.16.24) 56(84) bytes of data. From 192.168.16.7 icmp_seq=10 Destination Host Unreachable From 192.168.16.7 icmp_seq=11 Destination Host Unreachable From 192.168.16.7 icmp_seq=12 Destination Host Unreachable From 192.168.16.7 icmp_seq=14 Destination Host Unreachable From 192.168.16.7 icmp_seq=15 Destination Host Unreachable From 192.168.16.7 icmp_seq=16 Destination Host Unreachable From 192.168.16.7 icmp_seq=18 Destination Host Unreachable From 192.168.16.7 icmp_seq=19 Destination Host Unreachable From 192.168.16.7 icmp_seq=20 Destination Host Unreachable ... 64 bytes from 192.168.16.24: icmp_seq=91 ttl=64 time=0.440 ms 64 bytes from 192.168.16.24: icmp_seq=92 ttl=64 time=0.490 ms 64 bytes from 192.168.16.24: icmp_seq=93 ttl=64 time=0.412 ms 64 bytes from 192.168.16.24: icmp_seq=94 ttl=64 time=0.512 ms 64 bytes from 192.168.16.24: icmp_seq=95 ttl=64 time=0.383 ms 64 bytes from 192.168.16.24: icmp_seq=96 ttl=64 time=0.363 ms 64 bytes from 192.168.16.24: icmp_seq=97 ttl=64 time=0.399 ms --- 192.168.16.24 ping statistics --- 97 packets transmitted, 65 received, +18 errors, 32% packet loss, time 96040ms rtt min/avg/max/mdev = 0.226/25.135/1305.043/164.324 ms, pipe 3 |
|
#[root@fbsd4:~]# vim /etc/rc.conf
defaultrouter="192.168.16.254" ifconfig_re0="inet 192.168.16.24 netmask 255.255.255.0" hostname="fbsd4.net.nt" static_routes="54_32 54_64 54_96 54_128" route_54_32="-net 192.168.54.32/27 192.168.54.30" route_54_64="-net 192.168.54.64/27 192.168.54.30" ifconfig_re0=-net 192.168.54.96/27 192.168.54.30" ifconfig_re1="inet 192.168.54.1 netmask 255.255.255.224" route_54_64="-net 192.168.54.64/27 192.168.54.30" h route_54_96="-net 192.168.54.96/27 192.168.54.30" route_54_128="-net 192.168.54.128/27 192.168.54.30" ~ "/etc/rc.conf" 22 lines, 678 characters written |
|
#[root@fbsd4:~]# reboot
Connection to 192.168.16.24 closed by remote host. Connection to 192.168.16.24 closed. |
|
$scp 192.168.16.254:/etc/network/interfaces /tmp
The authenticity of host '192.168.16.254 (192.168.16.254)' can't be established. RSA key fingerprint is 90:7f:6c:4f:4c:b3:6c:3a:73:79:4d:77:f2:82:51:64. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). user@192.168.16.254's password: interfaces 100% 1971 1.9KB/s 00:00 |
|
$vim /tmp/interfaces
|
|
$ssh 192.168.16.5
|
|
$sudo route -n
[user@debian7:~]$ ssh 192.168.16.4 The authenticity of host '192.168.16.4 (192.168.16.4)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/user/.ssh/known_hosts). user@192.168.16.4's password: Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 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. ... Password: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.0 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.32 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.54.64 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.54.96 192.168.54.62 255.255.255.224 UG 0 0 0 eth2 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.1 0.0.0.0 UG 0 0 0 eth1 |
|
$sudo route -n >> /etc/network/interfaces
bash: /etc/network/interfaces: Permission denied |
|
$sudo sh -c '
|
|
$vim /etc/network/interfaces
|
|
$sudo
ifconfig eth1 inet static
address 192.168.54.30
netmask 255.255.255.224
gateway 192.168.54.1
~
~
~
~
~
~
~
~
~
12,0-1 Внизу
|
|
$sudo vim /etc/sysctl.conf
|
|
$reboot
bash: reboot: command not found |
|
$sudo
Broadcast message from root@debian4 (ttyp6) (Fri Jul 31 20:02:37 2009): The system is going down for reboot NOW! |
|
$ssh 192.168.16.5
|
|
#vim /etc/network/interfaces
|
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface |
|
#/etc/init.d/networking restart
Reconfiguring network interfaces.../etc/network/interfaces:8: too few parameters for iface line ifdown: couldn't read interfaces file "/etc/network/interfaces" /etc/network/interfaces:8: too few parameters for iface line ifup: couldn't read interfaces file "/etc/network/interfaces" failed. |
|
#vim /etc/network/interfaces
|
|
#/etc/init.d/networking restart
Reconfiguring network interfaces...done. |
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:05
inet addr:192.168.16.5 Bcast:192.168.16.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe00:5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6423 (6.2 KiB) TX bytes:994 (994.0 b)
|
|
#ifconfig
~
~
~
"/etc/network/interfaces" 18L, 526C записано
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:05
inet addr:192.168.16.5 Bcast:192.168.16.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe00:5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7068 (6.9 KiB) TX bytes:1332 (1.3 KiB)
|
|
#/etc/init.d/networking restart
Reconfiguring network interfaces...done. |
|
#/etc/init.d/networking restart
2 iface lo inet loopback$
address 192.168.16.5$
3 iface etnetmask 255.255.255.0$
5 gateway 192.168.16.254$
6 #
7 $
address 192.168.54.65$
8 iface ethnetmask 255.255.255.224$
10
11 $
address 192.168.54.62$
12 iface ethnetmask 255.255.255.224$
14
15 $
16 up route add default gw 192.168.54.33$
17 up route add -net 192.168.54.96 netmask 255.255.255.224 gw 192.168.54.94$
18 up route add -net 192.168.54.128 netmask 255.255.255.224 gw 192.168.54.94$
Reconfiguring network interfaces...done.
|
|
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:00:05
inet addr:192.168.16.5 Bcast:192.168.16.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe00:5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7668 (7.4 KiB) TX bytes:2224 (2.1 KiB)
eth1 Link encap:Ethernet HWaddr 00:16:3E:00:01:05
inet addr:192.168.54.65 Bcast:192.168.54.95 Mask:255.255.255.224
...
collisions:0 txqueuelen:1000
RX bytes:160 (160.0 b) TX bytes:238 (238.0 b)
eth2 Link encap:Ethernet HWaddr 00:16:3E:00:02:05
inet addr:192.168.54.62 Bcast:192.168.54.63 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:205/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 b) TX bytes:4428 (4.3 KiB)
|
|
#route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.54.128 192.168.54.94 255.255.255.224 UG 0 0 0 eth1 192.168.54.32 0.0.0.0 255.255.255.224 U 0 0 0 eth2 192.168.54.64 0.0.0.0 255.255.255.224 U 0 0 0 eth1 192.168.54.96 192.168.54.94 255.255.255.224 UG 0 0 0 eth1 192.168.16.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0.0.0.0 192.168.54.33 0.0.0.0 UG 0 0 0 eth2 |
|
#cat /proc/sys/net/ipv4/ip_forward
1 |
sys/ sysrq-trigger sysvipc/
1
| Время первой команды журнала | 17:45:43 2009- 7-31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Время последней команды журнала | 19:05:17 2009- 7-31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в журнале | 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент команд с ненулевым кодом завершения, % | 12.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Процент синтаксически неверно набранных команд, % | 1.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Суммарное время работы с терминалом *, час | 1.33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Количество командных строк в единицу времени, команда/мин | 1.26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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