通灵珠宝 嫣生如:单臂路由配置 - 凡尘的日志 - 网易博客
来源:百度文库 编辑:九乡新闻网 时间:2024/04/27 17:09:11
单臂路由配置
cisco配制手册 2007-12-11 09:47:33 阅读1951 评论0 字号:大中小 订阅
使用模拟器为CCNA交换版,使用其中设备R1,SW1,PC1,PC2。
路由器配置:
1设置F0/0接口无IP,开启接口。
interface FastEthernet0/0
no ip address
2在FA0/0接口上设置两个子接口,分别更改封装为DOT1Q,并设置各自的IP地址。
interface FastEthernet0/0.1
encapsulation dot1Q 2
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 3
ip address 2.2.2.1 255.255.255.0
要注意的是这里的VLAN号码要和交换机中的VLAN号对应起来。
交换机配置:
首先在交换机上划分两个VLAN。
Vlan 2 name pc1
Vlan 3 name pc2
1 将交换机连接路由器的接口设置为TRUNK。
interface FastEthernet1/5
switchport mode trunk
!
2 将交换机连接两台PC的接口绑定到不同的VLAN中去。
interface FastEthernet1/11
switchport access vlan 2
!
interface FastEthernet1/12
switchport access vlan 3
PC配置:
给PC的F0/0接口设置与路由器对应子接口同一网段的IP地址。
PC1
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
!
PC2
interface FastEthernet0/0
ip address 2.2.2.2 255.255.255.0
!
给两个PC分别设置一条缺省路由,将出口指向F0/0,即划分入VLAN的接口。
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
至此,单臂路由的实验配置完成。测试的时候在PC1上PING一下PC2,应该可以看到结果。
要点:1,注意子接口的IP要和PC的IP在同一网段。2,要确保所有接口的配置正确,并都打开了接口。3,作为PC使用的路由器上必须配置有正确的路由条目。
评论这张 转发至微博 0人 | 分享到: 阅读(1951)| 评论(0)| 引用 (0) |举报 剖析子网划分中的全0和全1