eigrp配置实验_知识扩展:路由器单臂路由配置

f745e69654a9ba646f2b4f8c711db692.png

4f17b3ff5efaff570bad73434946aae2.png

实验背景

某企业有两个主要部门,技术部和销售部,分处于不同的办公室,为了安全和便于管理对两个部门的主机进行了 VLAN 的划分,技术部和销售部分处于不同的 VLAN。现由于业务的需求需要销售部和技术部的主机能够相互访问,获得相应的资源,两个部门的交换机通过一台路由器进行了连接。

技术原理

单臂路由:是为实现 VLAN 间通信的三层网络设备路由器,它只需要一个以太网,通过创建子接口可以承担所有 VLAN 的网关,而在不同的 VLAN 间转发数据。

实验步骤

新建 packer tracer 拓扑图8ffded5297e494be69fa82b72cdcd581.png

当交换机设置两个 Vlan 时,逻辑上已经成为两个网络,广播被隔离了。两个 Vlan 的网络要通信,必须通过路由器,如果接入路由器的一个物理端口,则必须有两个子接口分别与两个 Vlan 对应,同时还要求与路由器相连得交换机的端口 fa 0/1 要设置为 trunk,因为这个接口要通过两个 Vlan 的数据包。

检查设置情况,应该能够正确的看到 Vlan 和 Trunk 信息。

计算机的网关分别指向路由器的子接口。

配置子接口,开启路由器物理接口。

默认封装 dot1q 协议。

配置路由器子接口 IP 地址。

实验设备

PC 2 台;Router_2811 1 台;Switch_2960 1 台

PC1
IP: 192.168.1.2
Submask: 255.255.255.0
Gateway:192.168.1.1

PC2
IP: 192.168.2.2
Submask: 255.255.255.0
Gateway:192.168.2.1

Switch
en
conf t
vlan 2
exit
vlan 3
exit
interface fastEthernet 0/2switchport access vlan 2exitint fa 0/3switchport access vlan 3exitint fa 0/1switchport mode trunkendshow vlanRouterenconf tint fa 0/0no shutdownexitinterface fast 0/0.1encapsulation dot1q 2 #将以太网子接口0/0.1划分到vlan 2,并且封装格式为802.1qip address 192.168.1.1 255.255.255.0exitint fa 0/0.2encapsulation dot1q 3 #将以太网子接口0/0.2划分到vlan 3,并且封装格式为802.1qip address 192.168.2.1 255.255.255.0endshow ip route

实战演练

配置交换机

Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#exitSwitch(config)#vlan 3Switch(config-vlan)#exitSwitch(config)#int fa 0/2Switch(config-if)#sw access vlan 2Switch(config-if)#exitSwitch(config)#int fa 0/3Switch(config-if)#sw access vlan 3Switch(config-if)#exitSwitch(config)#int fa 0/1Switch(config-if)#sw mode trunkSwitch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig1/1, Gig1/2
2 VLAN0002 active Fa0/2
3 VLAN0003 active Fa0/3
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
3 enet 100003 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
--More--
配置路由器
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int fa 0/0Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int fa 0/0.1
%LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to upRouter(config-subif)#encapsulation dot1q 2 #将以太网子接口0/0.1划分到vlan 2,并且封装格式为802.1qRouter(config-subif)#ip address 192.168.1.1 255.255.255.0Router(config-subif)#exitRouter(config)#int fa 0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to upRouter(config-subif)#encapsulation dot1q 3 #将以太网子接口0/0.2划分到vlan 3,并且封装格式为802.1qRouter(config-subif)#ip address 192.168.2.1 255.255.255.0Router(config-subif)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0.1
C 192.168.2.0/24 is directly connected, FastEthernet0/0.2
Router#

测  试

PC1 ping PC2

PC>ipconfig

IP Address......................: 192.168.1.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1

PC>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Request timed out.
Reply from 192.168.2.2: bytes=32 time=20ms TTL=127
Reply from 192.168.2.2: bytes=32 time=22ms TTL=127
Reply from 192.168.2.2: bytes=32 time=23ms TTL=127

Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 20ms, Maximum = 23ms, Average = 21ms

PC>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=28ms TTL=127
Reply from 192.168.2.2: bytes=32 time=19ms TTL=127
Reply from 192.168.2.2: bytes=32 time=21ms TTL=127
Reply from 192.168.2.2: bytes=32 time=22ms TTL=127

Ping statistics for 192.168.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 19ms, Maximum = 28ms, Average = 22ms

PC2 ping PC1

PC>ipconfig

IP Address......................: 192.168.2.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.2.1

PC>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time=22ms TTL=127
Reply from 192.168.1.2: bytes=32 time=26ms TTL=127
Reply from 192.168.1.2: bytes=32 time=24ms TTL=127
Reply from 192.168.1.2: bytes=32 time=21ms TTL=127

Ping statistics for 192.168.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 21ms, Maximum = 26ms, Average = 23ms

d369e8d617a7ce1013ad7d05a4b160e1.png

如果喜欢这位作者的文章,点点在看支持一下

3ad9a744976dd5975cbe332942c89405.png

END

35c17491954c7a12f3de0a331e37571f.png

官方站点:www.linuxprobe.com

 Linux命令大全:www.linuxcool.com

Linux系统下载站:www.linuxdown.com

e76e4f33bb6e48c02ae49e5f5f5803d5.png

刘遄老师QQ:5604922

Linux技术交流群:193666693

(新群,火热加群中……)

书籍在线学习(电脑阅读效果佳)

http://www.linuxprobe.com/chapter-00.html

    想要学习Linux系统的读者可以点击按钮来了解书籍《Linux就该这么学》,同时也非常适合专业的运维人员阅读,成为辅助您工作的高价值工具书!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值