480 lines
16 KiB
Markdown
480 lines
16 KiB
Markdown
|
## ifconfig
|
|||
|
|
|||
|
> ifconfig 命令用于显示或设置网络设备。
|
|||
|
>
|
|||
|
> ifconfig 可设置网络设备的状态,或是显示目前的设置。
|
|||
|
|
|||
|
### 语法
|
|||
|
|
|||
|
```
|
|||
|
ifconfig [网络设备][down up -allmulti -arp -promisc][add<地址>][del<地址>][<hw<网络设备类型><硬件地址>][io_addr<I/O地址>][irq<IRQ地址>][media<网络媒介类型>][mem_start<内存地址>][metric<数目>][mtu<字节>][netmask<子网掩码>][tunnel<地址>][-broadcast<地址>][-pointopoint<地址>][IP地址]
|
|||
|
```
|
|||
|
|
|||
|
**参数说明**:
|
|||
|
|
|||
|
- add<地址> 设置网络设备IPv6的IP地址。
|
|||
|
- del<地址> 删除网络设备IPv6的IP地址。
|
|||
|
- down 关闭指定的网络设备。
|
|||
|
- <hw<网络设备类型><硬件地址> 设置网络设备的类型与硬件地址。
|
|||
|
- io_addr<I/O地址> 设置网络设备的I/O地址。
|
|||
|
- irq<IRQ地址> 设置网络设备的IRQ。
|
|||
|
- media<网络媒介类型> 设置网络设备的媒介类型。
|
|||
|
- mem_start<内存地址> 设置网络设备在主内存所占用的起始地址。
|
|||
|
- metric<数目> 指定在计算数据包的转送次数时,所要加上的数目。
|
|||
|
- mtu<字节> 设置网络设备的MTU。
|
|||
|
- netmask<子网掩码> 设置网络设备的子网掩码。
|
|||
|
- tunnel<地址> 建立IPv4与IPv6之间的隧道通信地址。
|
|||
|
- up 启动指定的网络设备。
|
|||
|
- -broadcast<地址> 将要送往指定地址的数据包当成广播数据包来处理。
|
|||
|
- -pointopoint<地址> 与指定地址的网络设备建立直接连线,此模式具有保密功能。
|
|||
|
- -promisc 关闭或启动指定网络设备的promiscuous模式。
|
|||
|
- [IP地址] 指定网络设备的IP地址。
|
|||
|
- [网络设备] 指定网络设备的名称。
|
|||
|
|
|||
|
### 实例
|
|||
|
|
|||
|
显示网络设备信息
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig
|
|||
|
eth0 Link encap:Ethernet HWaddr 00:50:56:0A:0B:0C
|
|||
|
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
|
|||
|
inet6 addr: fe80::250:56ff:fe0a:b0c/64 Scope:Link
|
|||
|
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
|||
|
RX packets:172220 errors:0 dropped:0 overruns:0 frame:0
|
|||
|
TX packets:132379 errors:0 dropped:0 overruns:0 carrier:0
|
|||
|
collisions:0 txqueuelen:1000
|
|||
|
RX bytes:87101880 (83.0 MiB) TX bytes:41576123 (39.6 MiB)
|
|||
|
Interrupt:185 Base address:0x2024
|
|||
|
|
|||
|
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:2022 errors:0 dropped:0 overruns:0 frame:0
|
|||
|
TX packets:2022 errors:0 dropped:0 overruns:0 carrier:0
|
|||
|
collisions:0 txqueuelen:0
|
|||
|
RX bytes:2459063 (2.3 MiB) TX bytes:2459063 (2.3 MiB)
|
|||
|
```
|
|||
|
|
|||
|
启动关闭指定网卡
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 down
|
|||
|
# ifconfig eth0 up
|
|||
|
```
|
|||
|
|
|||
|
为网卡配置和删除IPv6地址
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 add 33ffe:3240:800:1005::2/ 64 //为网卡诶之IPv6地址
|
|||
|
|
|||
|
# ifconfig eth0 del 33ffe:3240:800:1005::2/ 64 //为网卡删除IPv6地址
|
|||
|
```
|
|||
|
|
|||
|
用ifconfig修改MAC地址
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 down //关闭网卡
|
|||
|
# ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE //修改MAC地址
|
|||
|
# ifconfig eth0 up //启动网卡
|
|||
|
# ifconfig eth1 hw ether 00:1D:1C:1D:1E //关闭网卡并修改MAC地址
|
|||
|
# ifconfig eth1 up //启动网卡
|
|||
|
```
|
|||
|
|
|||
|
配置IP地址
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 192.168.1.56
|
|||
|
//给eth0网卡配置IP地址
|
|||
|
# ifconfig eth0 192.168.1.56 netmask 255.255.255.0
|
|||
|
// 给eth0网卡配置IP地址,并加上子掩码
|
|||
|
# ifconfig eth0 192.168.1.56 netmask 255.255.255.0 broadcast 192.168.1.255
|
|||
|
// 给eth0网卡配置IP地址,加上子掩码,加上个广播地址
|
|||
|
```
|
|||
|
|
|||
|
启用和关闭ARP协议
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 arp //开启
|
|||
|
# ifconfig eth0 -arp //关闭
|
|||
|
```
|
|||
|
|
|||
|
设置最大传输单元
|
|||
|
|
|||
|
```
|
|||
|
# ifconfig eth0 mtu 1500
|
|||
|
//设置能通过的最大数据包大小为 1500 bytes
|
|||
|
```
|
|||
|
|
|||
|
## ping
|
|||
|
|
|||
|
> ping 命令用于检测主机。
|
|||
|
>
|
|||
|
> 执行 ping 指令会使用 ICMP 传输协议,发出要求回应的信息,若远端主机的网络功能没有问题,就会回应该信息,因而得知该主机运作正常。
|
|||
|
|
|||
|
### 语法
|
|||
|
|
|||
|
```
|
|||
|
ping [-dfnqrRv][-c<完成次数>][-i<间隔秒数>][-I<网络界面>][-l<前置载入>][-p<范本样式>][-s<数据包大小>][-t<存活数值>][主机名称或IP地址]
|
|||
|
```
|
|||
|
|
|||
|
**参数说明**:
|
|||
|
|
|||
|
- -d 使用Socket的SO_DEBUG功能。
|
|||
|
- -c<完成次数> 设置完成要求回应的次数。
|
|||
|
- -f 极限检测。
|
|||
|
- -i<间隔秒数> 指定收发信息的间隔时间。
|
|||
|
- -I<网络界面> 使用指定的网络界面送出数据包。
|
|||
|
- -l<前置载入> 设置在送出要求信息之前,先行发出的数据包。
|
|||
|
- -n 只输出数值。
|
|||
|
- -p<范本样式> 设置填满数据包的范本样式。
|
|||
|
- -q 不显示指令执行过程,开头和结尾的相关信息除外。
|
|||
|
- -r 忽略普通的Routing Table,直接将数据包送到远端主机上。
|
|||
|
- -R 记录路由过程。
|
|||
|
- -s<数据包大小> 设置数据包的大小。
|
|||
|
- -t<存活数值> 设置存活数值TTL的大小。
|
|||
|
- -v 详细显示指令的执行过程。
|
|||
|
|
|||
|
### 实例
|
|||
|
|
|||
|
检测是否与主机连通
|
|||
|
|
|||
|
```
|
|||
|
# ping www.w3cschool.cc //ping主机
|
|||
|
PING aries.m.alikunlun.com (114.80.174.110) 56(84) bytes of data.
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=1 ttl=64 time=0.025 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=2 ttl=64 time=0.036 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=3 ttl=64 time=0.034 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=4 ttl=64 time=0.034 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=5 ttl=64 time=0.028 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=6 ttl=64 time=0.028 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=7 ttl=64 time=0.034 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=8 ttl=64 time=0.034 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=9 ttl=64 time=0.036 ms
|
|||
|
64 bytes from 114.80.174.110: icmp_seq=10 ttl=64 time=0.041 ms
|
|||
|
|
|||
|
--- aries.m.alikunlun.com ping statistics ---
|
|||
|
10 packets transmitted, 30 received, 0% packet loss, time 29246ms
|
|||
|
rtt min/avg/max/mdev = 0.021/0.035/0.078/0.011 ms
|
|||
|
|
|||
|
//需要手动终止Ctrl+C
|
|||
|
```
|
|||
|
|
|||
|
指定接收包的次数
|
|||
|
|
|||
|
```
|
|||
|
# ping -c 2 www.w3cschool.cc
|
|||
|
PING aries.m.alikunlun.com (114.80.174.120) 56(84) bytes of data.
|
|||
|
64 bytes from 114.80.174.120: icmp_seq=1 ttl=54 time=6.18 ms
|
|||
|
64 bytes from 114.80.174.120: icmp_seq=2 ttl=54 time=15.4 ms
|
|||
|
|
|||
|
--- aries.m.alikunlun.com ping statistics ---
|
|||
|
2 packets transmitted, 2 received, 0% packet loss, time 1016ms
|
|||
|
rtt min/avg/max/mdev = 6.185/10.824/15.464/4.640 ms
|
|||
|
|
|||
|
//收到两次包后,自动退出
|
|||
|
```
|
|||
|
|
|||
|
多参数使用
|
|||
|
|
|||
|
```
|
|||
|
# ping -i 3 -s 1024 -t 255 g.cn //ping主机
|
|||
|
PING g.cn (203.208.37.104) 1024(1052) bytes of data.
|
|||
|
1032 bytes from bg-in-f104.1e100.net (203.208.37.104): icmp_seq=0 ttl=243 time=62.5 ms
|
|||
|
1032 bytes from bg-in-f104.1e100.net (203.208.37.104): icmp_seq=1 ttl=243 time=63.9 ms
|
|||
|
1032 bytes from bg-in-f104.1e100.net (203.208.37.104): icmp_seq=2 ttl=243 time=61.9 ms
|
|||
|
|
|||
|
--- g.cn ping statistics ---
|
|||
|
3 packets transmitted, 3 received, 0% packet loss, time 6001ms
|
|||
|
rtt min/avg/max/mdev = 61.959/62.843/63.984/0.894 ms, pipe 2
|
|||
|
[root@linux ~]#
|
|||
|
|
|||
|
//-i 3 发送周期为 3秒 -s 设置发送包的大小 -t 设置TTL值为 255
|
|||
|
```
|
|||
|
|
|||
|
## netstat
|
|||
|
|
|||
|
> netstat 命令用于显示网络状态。
|
|||
|
>
|
|||
|
> 利用 netstat 指令可让你得知整个Linux系统的网络情况。
|
|||
|
|
|||
|
### 语法
|
|||
|
|
|||
|
```
|
|||
|
netstat [-acCeFghilMnNoprstuvVwx][-A<网络类型>][--ip]
|
|||
|
```
|
|||
|
|
|||
|
**参数说明**:
|
|||
|
|
|||
|
- -a或--all 显示所有连线中的Socket。
|
|||
|
- -A<网络类型>或--<网络类型> 列出该网络类型连线中的相关地址。
|
|||
|
- -c或--continuous 持续列出网络状态。
|
|||
|
- -C或--cache 显示路由器配置的快取信息。
|
|||
|
- -e或--extend 显示网络其他相关信息。
|
|||
|
- -F或--fib 显示FIB。
|
|||
|
- -g或--groups 显示多重广播功能群组组员名单。
|
|||
|
- -h或--help 在线帮助。
|
|||
|
- -i或--interfaces 显示网络界面信息表单。
|
|||
|
- -l或--listening 显示监控中的服务器的Socket。
|
|||
|
- -M或--masquerade 显示伪装的网络连线。
|
|||
|
- -n或--numeric 直接使用IP地址,而不通过域名服务器。
|
|||
|
- -N或--netlink或--symbolic 显示网络硬件外围设备的符号连接名称。
|
|||
|
- -o或--timers 显示计时器。
|
|||
|
- -p或--programs 显示正在使用Socket的程序识别码和程序名称。
|
|||
|
- -r或--route 显示Routing Table。
|
|||
|
- -s或--statistice 显示网络工作信息统计表。
|
|||
|
- -t或--tcp 显示TCP传输协议的连线状况。
|
|||
|
- -u或--udp 显示UDP传输协议的连线状况。
|
|||
|
- -v或--verbose 显示指令执行过程。
|
|||
|
- -V或--version 显示版本信息。
|
|||
|
- -w或--raw 显示RAW传输协议的连线状况。
|
|||
|
- -x或--unix 此参数的效果和指定"-A unix"参数相同。
|
|||
|
- --ip或--inet 此参数的效果和指定"-A inet"参数相同。
|
|||
|
|
|||
|
### 实例
|
|||
|
|
|||
|
显示详细的网络状况
|
|||
|
|
|||
|
```
|
|||
|
# netstat -a
|
|||
|
```
|
|||
|
|
|||
|
显示当前户籍UDP连接状况
|
|||
|
|
|||
|
```
|
|||
|
# netstat -nu
|
|||
|
```
|
|||
|
|
|||
|
显示UDP端口号的使用情况
|
|||
|
|
|||
|
```
|
|||
|
# netstat -apu
|
|||
|
Active Internet connections (servers and established)
|
|||
|
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
|
|||
|
udp 0 0 *:32768 *:* -
|
|||
|
udp 0 0 *:nfs *:* -
|
|||
|
udp 0 0 *:641 *:* 3006/rpc.statd
|
|||
|
udp 0 0 192.168.0.3:netbios-ns *:* 3537/nmbd
|
|||
|
udp 0 0 *:netbios-ns *:* 3537/nmbd
|
|||
|
udp 0 0 192.168.0.3:netbios-dgm *:* 3537/nmbd
|
|||
|
udp 0 0 *:netbios-dgm *:* 3537/nmbd
|
|||
|
udp 0 0 *:tftp *:* 3346/xinetd
|
|||
|
udp 0 0 *:999 *:* 3366/rpc.rquotad
|
|||
|
udp 0 0 *:sunrpc *:* 2986/portmap
|
|||
|
udp 0 0 *:ipp *:* 6938/cupsd
|
|||
|
udp 0 0 *:1022 *:* 3392/rpc.mountd
|
|||
|
udp 0 0 *:638 *:* 3006/rpc.statd
|
|||
|
```
|
|||
|
|
|||
|
显示网卡列表
|
|||
|
|
|||
|
```
|
|||
|
# netstat -i
|
|||
|
Kernel Interface table
|
|||
|
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
|
|||
|
eth0 1500 0 181864 0 0 0 141278 0 0 0 BMRU
|
|||
|
lo 16436 0 3362 0 0 0 3362 0 0 0 LRU
|
|||
|
```
|
|||
|
|
|||
|
显示组播组的关系
|
|||
|
|
|||
|
```
|
|||
|
# netstat -g
|
|||
|
IPv6/IPv4 Group Memberships
|
|||
|
Interface RefCnt Group
|
|||
|
--------------- ------ ---------------------
|
|||
|
lo 1 ALL-SYSTEMS.MCAST.NET
|
|||
|
eth0 1 ALL-SYSTEMS.MCAST.NET
|
|||
|
lo 1 ff02::1
|
|||
|
eth0 1 ff02::1:ff0a:b0c
|
|||
|
eth0 1 ff02::1
|
|||
|
```
|
|||
|
|
|||
|
显示网络统计信息
|
|||
|
|
|||
|
```
|
|||
|
# netstat -s
|
|||
|
Ip:
|
|||
|
184695 total packets received
|
|||
|
0 forwarded
|
|||
|
0 incoming packets discarded
|
|||
|
184687 incoming packets delivered
|
|||
|
143917 requests sent out
|
|||
|
32 outgoing packets dropped
|
|||
|
30 dropped because of missing route
|
|||
|
Icmp:
|
|||
|
676 ICMP messages received
|
|||
|
5 input ICMP message failed.
|
|||
|
ICMP input histogram:
|
|||
|
destination unreachable: 44
|
|||
|
echo requests: 287
|
|||
|
echo replies: 345
|
|||
|
304 ICMP messages sent
|
|||
|
0 ICMP messages failed
|
|||
|
ICMP output histogram:
|
|||
|
destination unreachable: 17
|
|||
|
echo replies: 287
|
|||
|
Tcp:
|
|||
|
473 active connections openings
|
|||
|
28 passive connection openings
|
|||
|
4 failed connection attempts
|
|||
|
11 connection resets received
|
|||
|
1 connections established
|
|||
|
178253 segments received
|
|||
|
137936 segments send out
|
|||
|
29 segments retransmited
|
|||
|
0 bad segments received.
|
|||
|
336 resets sent
|
|||
|
Udp:
|
|||
|
5714 packets received
|
|||
|
8 packets to unknown port received.
|
|||
|
0 packet receive errors
|
|||
|
5419 packets sent
|
|||
|
TcpExt:
|
|||
|
1 resets received for embryonic SYN_RECV sockets
|
|||
|
ArpFilter: 0
|
|||
|
12 TCP sockets finished time wait in fast timer
|
|||
|
572 delayed acks sent
|
|||
|
3 delayed acks further delayed because of locked socket
|
|||
|
13766 packets directly queued to recvmsg prequeue.
|
|||
|
1101482 packets directly received from backlog
|
|||
|
19599861 packets directly received from prequeue
|
|||
|
46860 packets header predicted
|
|||
|
14541 packets header predicted and directly queued to user
|
|||
|
TCPPureAcks: 12259
|
|||
|
TCPHPAcks: 9119
|
|||
|
TCPRenoRecovery: 0
|
|||
|
TCPSackRecovery: 0
|
|||
|
TCPSACKReneging: 0
|
|||
|
TCPFACKReorder: 0
|
|||
|
TCPSACKReorder: 0
|
|||
|
TCPRenoReorder: 0
|
|||
|
TCPTSReorder: 0
|
|||
|
TCPFullUndo: 0
|
|||
|
TCPPartialUndo: 0
|
|||
|
TCPDSACKUndo: 0
|
|||
|
TCPLossUndo: 0
|
|||
|
TCPLoss: 0
|
|||
|
TCPLostRetransmit: 0
|
|||
|
TCPRenoFailures: 0
|
|||
|
TCPSackFailures: 0
|
|||
|
TCPLossFailures: 0
|
|||
|
TCPFastRetrans: 0
|
|||
|
TCPForwardRetrans: 0
|
|||
|
TCPSlowStartRetrans: 0
|
|||
|
TCPTimeouts: 29
|
|||
|
TCPRenoRecoveryFail: 0
|
|||
|
TCPSackRecoveryFail: 0
|
|||
|
TCPSchedulerFailed: 0
|
|||
|
TCPRcvCollapsed: 0
|
|||
|
TCPDSACKOldSent: 0
|
|||
|
TCPDSACKOfoSent: 0
|
|||
|
TCPDSACKRecv: 0
|
|||
|
TCPDSACKOfoRecv: 0
|
|||
|
TCPAbortOnSyn: 0
|
|||
|
TCPAbortOnData: 1
|
|||
|
TCPAbortOnClose: 0
|
|||
|
TCPAbortOnMemory: 0
|
|||
|
TCPAbortOnTimeout: 3
|
|||
|
TCPAbortOnLinger: 0
|
|||
|
TCPAbortFailed: 3
|
|||
|
TCPMemoryPressures: 0
|
|||
|
```
|
|||
|
|
|||
|
显示监听的套接口
|
|||
|
|
|||
|
```
|
|||
|
# netstat -l
|
|||
|
Active Internet connections (only servers)
|
|||
|
Proto Recv-Q Send-Q Local Address Foreign Address State
|
|||
|
tcp 0 0 *:32769 *:* LISTEN
|
|||
|
tcp 0 0 *:nfs *:* LISTEN
|
|||
|
tcp 0 0 *:644 *:* LISTEN
|
|||
|
tcp 0 0 *:1002 *:* LISTEN
|
|||
|
tcp 0 0 *:netbios-ssn *:* LISTEN
|
|||
|
tcp 0 0 *:sunrpc *:* LISTEN
|
|||
|
tcp 0 0 vm-dev:ipp *:* LISTEN
|
|||
|
tcp 0 0 *:telnet *:* LISTEN
|
|||
|
tcp 0 0 *:601 *:* LISTEN
|
|||
|
tcp 0 0 *:microsoft-ds *:* LISTEN
|
|||
|
tcp 0 0 *:http *:* LISTEN
|
|||
|
tcp 0 0 *:ssh *:* LISTEN
|
|||
|
tcp 0 0 *:https *:* LISTEN
|
|||
|
udp 0 0 *:32768 *:*
|
|||
|
udp 0 0 *:nfs *:*
|
|||
|
udp 0 0 *:641 *:*
|
|||
|
udp 0 0 192.168.0.3:netbios-ns *:*
|
|||
|
udp 0 0 *:netbios-ns *:*
|
|||
|
udp 0 0 192.168.0.3:netbios-dgm *:*
|
|||
|
udp 0 0 *:netbios-dgm *:*
|
|||
|
udp 0 0 *:tftp *:*
|
|||
|
udp 0 0 *:999 *:*
|
|||
|
udp 0 0 *:sunrpc *:*
|
|||
|
udp 0 0 *:ipp *:*
|
|||
|
udp 0 0 *:1022 *:*
|
|||
|
udp 0 0 *:638 *:*
|
|||
|
Active UNIX domain sockets (only servers)
|
|||
|
Proto RefCnt Flags Type State I-Node Path
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10621 @/tmp/fam-root-
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 7096 /var/run/acpid.socket
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 9792 /tmp/.gdm_socket
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 9927 /tmp/.X11-unix/X0
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10489 /tmp/ssh-lbUnUf4552/agent.4552
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10558 /tmp/ksocket-root/kdeinit__0
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10560 /tmp/ksocket-root/kdeinit-:0
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10570 /tmp/.ICE-unix/dcop4664-1270815442
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10843 /tmp/.ICE-unix/4735
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10591 /tmp/ksocket-root/klauncherah3arc.slave-socket
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 7763 /var/run/iiim/.iiimp-unix/9010
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 11047 /tmp/orbit-root/linc-1291-0-1e92c8082411
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 11053 /tmp/orbit-root/linc-128e-0-dc070659cbb3
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 8020 /var/run/dbus/system_bus_socket
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 58927 /tmp/mcop-root/vm-dev-2c28-4beba75f
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 7860 /tmp/.font-unix/fs7100
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 7658 /dev/gpmctl
|
|||
|
unix 2 [ ACC ] STREAM LISTENING 10498 @/tmp/dbus-s2MLJGO5Ci
|
|||
|
```
|
|||
|
|
|||
|
## telnet
|
|||
|
|
|||
|
> telnet 命令用于远端登入。
|
|||
|
>
|
|||
|
> 执行telnet指令开启终端机阶段作业,并登入远端主机。
|
|||
|
|
|||
|
### 语法
|
|||
|
|
|||
|
```
|
|||
|
telnet [-8acdEfFKLrx][-b<主机别名>][-e<脱离字符>][-k<域名>][-l<用户名称>][-n<记录文件>][-S<服务类型>][-X<认证形态>][主机名称或IP地址<通信端口>]
|
|||
|
```
|
|||
|
|
|||
|
**参数说明**:
|
|||
|
|
|||
|
- -8 允许使用8位字符资料,包括输入与输出。
|
|||
|
- -a 尝试自动登入远端系统。
|
|||
|
- -b<主机别名> 使用别名指定远端主机名称。
|
|||
|
- -c 不读取用户专属目录里的.telnetrc文件。
|
|||
|
- -d 启动排错模式。
|
|||
|
- -e<脱离字符> 设置脱离字符。
|
|||
|
- -E 滤除脱离字符。
|
|||
|
- -f 此参数的效果和指定"-F"参数相同。
|
|||
|
- -F 使用Kerberos V5认证时,加上此参数可把本地主机的认证数据上传到远端主机。
|
|||
|
- -k<域名> 使用Kerberos认证时,加上此参数让远端主机采用指定的领域名,而非该主机的域名。
|
|||
|
- -K 不自动登入远端主机。
|
|||
|
- -l<用户名称> 指定要登入远端主机的用户名称。
|
|||
|
- -L 允许输出8位字符资料。
|
|||
|
- -n<记录文件> 指定文件记录相关信息。
|
|||
|
- -r 使用类似rlogin指令的用户界面。
|
|||
|
- -S<服务类型> 设置telnet连线所需的IP TOS信息。
|
|||
|
- -x 假设主机有支持数据加密的功能,就使用它。
|
|||
|
- -X<认证形态> 关闭指定的认证形态。
|
|||
|
|
|||
|
### 实例
|
|||
|
|
|||
|
登录远程主机
|
|||
|
|
|||
|
```
|
|||
|
# telnet 192.168.0.5
|
|||
|
|
|||
|
//登录IP为 192.168.0.5 的远程主机
|
|||
|
```
|