那么到这里,计算机网络原理快速介绍就结束了。现在我们已经知道了一些层面是如何沟通的了。也了解了在我们的计算机中应该提供什么样的服务才能进行有效的通信了。现在我们进行下一步。在我们的例子中怎么才能看出来网络配置是正确的呢,其实可以使用图形程序,但现在我们只能使用系统安装的ifconfig。这个程序可以显示或设置我们网络中所有的信息。下面是一个示例,输入ifconfig命令,显示了我目前的工作站还未连接到网络的情况:

root [~] # ifconfig

eth0 Link encap: Ethernet HWaddr dc: 0e: a1: 4b: 5d: 94

inet addr: 169.254.186.86 bcast: 169.254.255.255 Mask: 255.255.0.0

UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1

RX packets: 0 errors: 0 dropped: 2775300121 overruns: 0 frame: 0

TX packets: 2790 errors: 0 dropped: 0 overruns: 0 carrier: 0

collisions: 0 txqueuelen: 1000

RX bytes: 0 (0.0 B) TX bytes: 625441 (610.7 KB)

Interrupt: 122 Base address: 0×6000

lo Link encap: Local Loopback

inet addr: 127.0.0.1 Mask: 255.0.0.0

UP LOOPBACK RUNNING MTU: 16436 Metric: 1

RX packets: 1003 errors: 0 dropped: 0 overruns: 0 frame: 0

TX packets: 1003 errors: 0 dropped: 0 overruns: 0 carrier: 0

collisions: 0 txqueuelen: 0

RX bytes: 379547 (370.6 KiB) TX bytes: 379547 (370.6 KB)

root [~] #

All program options in ifoconfig. I wrote the following:

ifconfig [-a] [-v] [-s] [[]]

[Add <address>[/ <prefixlen>]]

[Del <address>[/ <prefixlen>]]

[[-] Broadcast [<address>]] [[-] pointopoint [address]]

[Netmask <address>] [dstaddr <address>] [tunnel <address>]

[Outfill <nn>] [keepalive <nn>]

[H <HW> <address>] [metric <nn>] [mtu <nn>]

[[-] Trailers] [[-] arp] [[-] allmulti]

[Multicast] [[-] promisc]

[Mem_start <nn>] [io_addr <nn>] [irq <nn>] [media <type>]

[Txqueuelen <nn>]

[[-] Dynamic]

[Up | down] …

<HW>= Hardware Type.

List of possible hardware types:

loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)

slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)

strip (Metricom Starmode IP) ether (Ethernet) tr (16/4 Mbps Token Ring)

tr (16/4 Mbps Token Ring (New)) ax25 (AX.25 Amp R) netrom (ampr NET / ROM)

tunnel (IPIP Tunnel) ppp (Point-to-Point Protocol) arcnet (ARCnet)

DLCI (Frame Relay DLCI) FRAD (Frame Relay Access Device) irda (IrLAP)

x25 (generic X.25)

<AF>= Address family. Default: inet

List of possible address families:

unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)

ax25 (AX.25 Amp R) netrom (ampr NET / ROM) ipx (Novell IPX)

ddp (Appletalk DDP) x25 (CCITT X.25)

However, if you want to know more about this program, just type "main ifoconfig" in the console.

Wireless configuration is used in the iwconfig command console. This command takes the following parameters:

Usage: iwconfig [interface]

interface essid {NNN | any | on | off}

interface mode {managed | ad-hoc | master | …}

N.NNN interface freq [k | M | G]

interface channel N

interface bit {N [k | M | G] | auto | fixed}

interface rate {N [k | M | G] | auto | fixed}

enc {NNNN interface-NNNN | off}

interface key {NNNN-NNNN | off}

interface power {period N | timeout N | saving N | off}

NNN nickname interface

interface nwid {NN | on | off}

interface ap {N | off | auto}

interface txpower {nmw | NDBM | off | auto}

interface point N

interface retry {limit N | lifetime N}

interface rts {N | auto | fixed | off}

interface frag {N | auto | fixed | off}

interface modulation {11g | 11a | CCK | OFDMg | …}

interface commit


相关内容