路由器的基本配置实验报告_第二节:路由器基本配置命令2

2.1:思科CDP发现协议。

2.2:公有LLDP发现协议。

2.3:保存配置命令及其他命令。

2.4:设备配置IP地址及静态路由配置。

ae9c32d92627de5e84e8bcf36d0ba655.png

R1(config)#cdp run //全局配置cdp

R1(config)#interface ethernet 0/0 //进入接口

R1(config-if)#no shutdown //开启接口

R1(config-if)#cdp run //接口下开启cdp

R1(config)#interface ethernet 0/0 //进入接口

R1(config-if)#ip address 12.1.1.1 255.255.255.0 //配置IP地址

R1(config-if)#no shutdown //开启接口

R2(config)#interface ethernet 0/0 //进入接口

R2(config-if)#ip address 12.1.1.2 255.255.255.0 //配置IP地址

R2(config-if)#no shutdown //开启接口

R1(config)#do ping 12.1.1.2 //测试R1和R2的通信

Type escape sequence to abort.

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

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 2/4/5 ms

R1#show cdp neighbors //查看CDP邻居

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,

D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID Local Intrfce Holdtme Capability Platform Port ID

R2 Eth 0/0 167 R B Linux Uni Eth 0/0

Total cdp entries displayed : 1

R1(config)#no cdp run //关闭cdp

R1(config)#do show cdp neighbors //查看CDP邻居

% CDP is not enabled //cdp未开启

R1(config)#lldp run //运行公有LLDP

R2(config)#lldp run //运行公有LLDP

R1(config)#do show lldp neighbors //查看lldp邻居

Capability codes:

(R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device

(W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID Local Intf Hold-time Capability Port ID

R2 Et0/0 120 R Et0/0

Total entries displayed: 1

R1#copy running-config startup-config //保存配置文件

Destination filename [startup-config]?

Building configuration...

[OK]

R2#write //保存配置文件

Building configuration...

[OK]

R1#erase startup-config //清除启动配置

R1#show running-config //清除运行配置

R1#show startup-config //查看启动配置

R1#show ip interface brief //查看接口配置信息

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 12.1.1.1 YES manual up up

R2#show ip interface brief //查看接口配置信息

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 12.1.1.2 YES manual up up

R1(config)#interface loopback 0 //创建环回口0

Oct 4 22:18:10.700: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R1(config-if)#ip address 1.1.1.1 255.255.255.0 //创建环回口0的ip地址

R1(config-if)#no shutdown

R2(config)#interface loopback 0 //创建环回口0

Oct 4 22:18:10.700: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R2(config-if)#ip address 2.2.2.2 255.255.255.0 //创建环回口0的ip地址

R2(config-if)#no shutdown

R1#ping 2.2.2.2 source 1.1.1.1 //测试R1环回口与R2环回口通信

Type escape sequence to abort.

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

Packet sent with a source address of 1.1.1.1

.....

Success rate is 0 percent (0/5)

R1(config)#ip route 2.2.2.2 255.255.255.255 e0/0 12.1.1.2 10 //配置静态路由metric为10

R2(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.1 //配置默认静态路由metric为

R1#ping 2.2.2.2 source 1.1.1.1 //测试R1环回口与R2环回口通信

Type escape sequence to abort.

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

Packet sent with a source address of 1.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/5 ms

R1#traceroute 2.2.2.2 source 1.1.1.1 numeric //路由跟踪

Type escape sequence to abort.

Tracing the route to 2.2.2.2

VRF info: (vrf in name/id, vrf out name/id)

1 12.1.1.2 1 msec * 1 msec

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值