📄 5.t
字号:
.\" Copyright (c) 1980, 1986, 1988, 1993 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)5.t 8.1 (Berkeley) 7/27/93.\".ds lq ``.ds rq ''.ds LH "Installing/Operating \*(4B.ds RH Network setup.ds CF \*(Dy.Sh 1 "Network setup".PP\*(4B provides support for the standard Internetprotocols IP, ICMP, TCP, and UDP. These protocols may be usedon top of a variety of hardware devices ranging fromserial lines to local area network controllersfor the Ethernet. Network services are split between thekernel (communication protocols) and user programs (userservices such as TELNET and FTP). This section describeshow to configure your system to use the Internet networking support.\*(4B also supports the Xerox Network Systems (NS) protocols.IDP and SPP are implemented in the kernel,and other protocols such as Courier run at the user level.\*(4B provides some support for the ISO OSI protocols CLNPTP4, and ESIS. User level processcomplete the application protocols such as X.400 and X.500..Sh 2 "System configuration".PPTo configure the kernel to include the Internet communicationprotocols, define the INET option.Xerox NS support is enabled with the NS option.ISO OSI support is enabled with the ISO option.In either case, include the pseudo-devices``pty'', and ``loop'' in your machine's configurationfile. The ``pty'' pseudo-device forces the pseudo terminal device driverto be configured into the system, see.Xr pty (4),while the ``loop'' pseudo-device forces inclusion of the software loopbackinterface driver.The loop driver is used in network testingand also by the error logging system..PPIf you are planning to use the Internet network facilities on a 10Mb/sEthernet, the pseudo-device ``ether'' should also be includedin the configuration; this forces inclusion of the Address ResolutionProtocol module used in mapping between 48-bit Ethernetand 32-bit Internet addresses..PPBefore configuring the appropriate networking hardware, you shouldconsult the manual pages in section 4 of the Programmer's Manualselecting the appropriate interfaces for your architecture..PPAll network interface drivers including the loopback interface,require that their host address(es) be defined at boot time.This is done with.Xr ifconfig (8)commands included in the.Pn /etc/netstartfile.Interfaces that are able to dynamically deduce the hostpart of an address may check that the host part of the address is correct.The manual page for each network interfacedescribes the method used to establish a host's address..Xr Ifconfig (8)can also be used to set options for the interface at boot time.Options are set independently for each interface, andapply to all packets sent using that interface.Alternatively, translations for such hosts may be set in advanceor ``published'' by a \*(4B host by use of the.Xr arp (8)command.Note that the use of trailer link-level is now negotiated between \*(4B hostsusing ARP,and it is thus no longer necessary to disable the use of trailerswith.Xr ifconfig ..PPThe OSI equivalent to ARP is ESIS (End System to Intermediate System RoutingProtocol); running this protocol is mandatory, however one can manually addtranslations for machines that do not participate by use of the.Xr route (8)command.Additional information is provided in the manual page describing.Xr ESIS (4)..PPTo use the pseudo terminals just configured, deviceentries must be created in the.Pn /devdirectory. To create 32pseudo terminals (plenty, unless you have a heavy network load)execute the following commands..DS\fB#\fP \fIcd /dev\fP\fB#\fP \fIMAKEDEV pty0 pty1\fP.DEMore pseudo terminals may be made by specifying.Pn pty2 ,.Pn pty3 ,etc. The kernel normally includes support for 32 pseudo terminalsunless the configuration file specifies a different number.Each pseudo terminal really consists of two files in.Pn /dev :a master and a slave. The master pseudo terminal file is named.Pn /dev/ptyp? ,while the slave side is.Pn /dev/ttyp? .Pseudo terminals are also used by several programs not related to the network.In addition to creating the pseudo terminals,be sure to install them in the.Pn /etc/ttysfile (with a `none' in the second column so no.Xr gettyis started)..Sh 2 "Local subnets".PPIn \*(4B the Internet supportincludes the notion of ``subnets''. This is a mechanismby which multiple local networks may appears as a single Internetnetwork to off-site hosts. Subnetworks are useful becausethey allow a site to hide their local topology, requiring only a singleroute in external gateways;it also means that local network numbers may be locally administered.The standard describing this change in Internet addressing is RFC-950..PPTo set up local subnets one must first decide how the availableaddress space (the Internet ``host part'' of the 32-bit address)is to be partitioned.Sites with a class A networknumber have a 24-bit host address space with which to work, sites with aclass B network number have a 16-bit host address space, while sites witha class C network number have an 8-bit host address space\**..FSIf you are unfamiliar with the Internet addressing structure, consult``Address Mappings'', Internet RFC-796, J. Postel; available fromthe Internet Network Information Center at SRI..FETo define local subnets you must steal some bitsfrom the local host address space for use in extending the networkportion of the Internet address. This reinterpretation of Internetaddresses is done only for local networks; i.e. it is not visibleto hosts off-site. For example, if your site has a class B networknumber, hosts on this network have an Internet address that containsthe network number, 16 bits, and the host number, another16 bits. To define 254 local subnets, eachpossessing at most 255 hosts, 8 bits may be taken from the local part.(The use of subnets 0 and all-1's, 255 in this example, is discouragedto avoid confusion about broadcast addresses.)These new networknumbers are then constructed by concatenating the original 16-bit networknumber with the extra 8 bits containing the local subnet number..PPThe existence of local subnets is communicated to the system at the time anetwork interface is configured with the.I netmaskoption to the.Xr ifconfigprogram. A ``network mask'' is specified to define theportion of the Internet address that is to be considered the network partfor that network.This mask normally contains the bits corresponding to the standardnetwork part as well as the portion of the local partthat has been assigned to subnets.If no mask is specified when the address is set,it will be set according to the class of the network.For example, at Berkeley (class B network 128.32) 8 bitsof the local part have been reserved for defining subnets;consequently the.Pn /etc/netstartfile contains lines of the form.DS.ft CW/sbin/ifconfig le0 netmask 0xffffff00 128.32.1.7.DEThis specifies that for interface ``le0'', the upper 24 bits ofthe Internet address should be used in calculating network numbers(netmask 0xffffff00), and the interface's Internet address is``128.32.1.7'' (host 7 on network 128.32.1). Hosts \fIm\fP onsub-network \fIn\fP of this network would then have addresses ofthe form ``128.32.\fIn\fP.\fIm\fP''; for example, host99 on network 129 would have an address ``128.32.129.99''.For hosts with multiple interfaces, the network mask shouldbe set for each interface,although in practice only the mask of the first interface on each networkis really used..Sh 2 "Internet broadcast addresses".PPThe address defined as the broadcast address for Internet networksaccording to RFC-919 is the address with a host part of all 1's.The address used by 4.2BSD was the address with a host part of 0.\*(4B uses the standard broadcast address (all 1's) by default,but allows the broadcast address to be set (with.Xr ifconfig )for each interface.This allows networks consisting of both 4.2BSD, \*(Ps and \*(4B hoststo coexist while the upgrade process proceeds.In the presence of subnets, the broadcast address uses the subnet fieldas for normal host addresses, with the remaining host part set to 1's(or 0's, on a network that has not yet been converted).\*(4B hosts recognize and accept packetssent to the logical-network broadcast address as well as those sentto the subnet broadcast address, and when using an all-1's broadcast,also recognize and receive packets sent to host 0 as a broadcast..Sh 2 "Routing".PPIf your environment allows access to networks not directlyattached to your host you will need to set up routing informationto allow packets to be properly routed. Two schemes aresupported by the system. The first schemeemploys a routing table management daemon.Optimally, you should use the routing daemon.Xr gatedavailable from Cornell university.We use it on our systems and it works well,especially for multi-homed hosts using Serial Line IP (SLIP).Unfortunately, we were not able to obtain permission toinclude it on \*(4B..PPIf you do not wish to or cannot obtain.Xr gated ,the distribution does include.Xr routed (8)to maintain the system routing tables. The routing daemonuses a variant of the Xerox Routing Information Protocolto maintain up to date routing tables in a cluster of localarea networks. By using the.Pn /etc/gatewaysfile, the routing daemon can also be used to initialize static routesto distant networks (see the next section for further discussion).When the routing daemon is started up(usually from.Pn /etc/rc )it reads.Pn /etc/gatewaysif it exists and installs those routes defined there,then broadcasts on each local networkto which the host is attached to find other instances of the routingdaemon. If any responses are received, the routing daemonscooperate in maintaining a globally consistent view of routingin the local environment. This view can be extended to includeremote sites also running the routing daemon by setting up suitableentries in.Pn /etc/gateways ;consult.Xr routed (8)for a more thorough discussion..PPThe second approach is to define a default or wildcardroute to a smartgateway and depend on the gateway to provide ICMP routingredirect information to dynamically create a routing database. This is done by adding an entry of the form.DS.ft CW/sbin/route add default \fIsmart-gateway\fP 1.DEto.Pn /etc/netstart ;see.Xr route (8)for more information. The default routewill be used by the system as a ``last resort''in routing packets to their destination. Assuming the gatewayto which packets are directed is able to generate the properrouting redirect messages, the system will then add routingtable entries based on the information supplied. This approach
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -