在linux下 怎么查看网络接口的名字

在linux下 怎么查看网络接口的名字,第1张

1、第一步在电脑上打开xshell,建立连接,输入主机名,用户名和密码,如下图所示:

2、第二步可以看到已经远程连接到linux系统服务器了,如下图所示:

3、第三步输入“ifconfig -a”命令,来查看linux系统ip,如下图所示:

4、第四步按回车键之后,可以查看到linux系统的ip地址,在eth0的下方inet旁边就是内网ip地址,如下图所示:

5、第五步也可以看一下按回车键的信息,eth0是网卡名称,lo是本地环回接口,netmask是本机掩码,如下图所示:

Router>enable 进入特权模式

Router#configure terminal 进入配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#interface e 0/0 进入接口以太0/0

Router(config-if)#ip

Router(config-if)#ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码

Router(config-if)#no shutdown 开启端口

%LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up

Router(config-if)#exit退出

Router(config)#ip host xiay 192.168.1.2默认域名指向(可以不配置的)

Router(config)#exit退出

Router#show interfaces e 0/0查看以太0/0信息

Ethernet0/0 is up, line protocol is up开启端口

Hardware is Lance, address is 000C.4198.5973 (bia 000C.4198.5973)MAC地址

Internet address is 192.168.1.1/24IP和掩码

MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255

Encapsulation ARPA, loopback not set, keepalive set (10 sec)

ARP type: ARPA, ARP Timeout 04:00:00

Last input 00:00:00, output 00:00:00, output hang never

Last clearing of show interface counters never

Queueing strategy: fifo

Output queue 0/40, 0 dropsinput queue 0/75, 0 drops

5 minute input rate 1000 bits/sec, 2 packets/sec

5 minute output rate 1000 bits/sec, 2 packets/sec

0 packets input, 0 bytes, 0 no buffer

Received 0 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

0 input packets with dribble condition detected

0 packets output, 0 bytes, 0 underruns

0 output errors, 0 collisions, 0 interface resets

0 babbles, 0 late collision, 0 deferred

0 lost carrier, 0 no carrier

0 output buffer failures, 0 output buffers swapped out

Router#ping 192.168.1.2pingIP地址

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms通了

Router#ping xiayping 域名(就是刚才定向的那个)

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms通了

Router#copy startup-config tftp 拷贝我的配置文件到tftp

Address or name of remote host []?xiay拷贝到这(也可以输入IP)

Destination filename []?1保存文件名

No NVRAM configuration present失败

Router#

Router#show startup-config 检查我的配置 没有

%% Non-volatile configuration memory is not present

Router#copy running-config startup-config 把我ram上的配置copy到nvram上去

Destination filename [startup-config]?

Building configuration...

[OK]

Router#sh startup-config 再查看下 OK东西有了

Current configuration : 677 bytes

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Router

!

!

!

ip subnet-zero

ip host xiay 192.168.1.2

!

!

!

!

!

!

!

!

!

Router#copy startup-config tftp 拷贝 同上

Address or name of remote host []?xiay

Destination filename []?1

!!!!!!!!!!成功了!!!!!!!

[OK]

8390 bytes copied in 7 secs

===================================

boson 行敲出来顺便给你贴上去的 够详细了把 不加分对不起我啊

Linux怎么查看端口是否开启?我们一起来了解一下吧。

首先我们先打开要查看端口的Linux的命令 *** 作界面,

然后为了能够获得更高的权限,切换root用户登录

第一个方法就是使用lsof-i:端口号命令行,以80为例的,

如果没有任何输出则说明没有开启该端口号,为了方便测试,我这里检测一个开启的端口号,则会输出如图所示的信息

第二个方法就是使用netstat-aptn命令行,查看所有开启的端口号,

本文章基于ThinkpadE15品牌、centos7系统撰写的。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/yw/8931767.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-23
下一篇2023-04-23

发表评论

登录后才能评论

评论列表(0条)

    保存