- 积分
- 57
- 鸿鹄币
- 个
- 好评度
- 点
- 精华
- 注册时间
- 2012-11-24
- 最后登录
- 1970-1-1
- 阅读权限
- 20
- 听众
- 收听
助理工程师
 
|
为啥vlan间ping不通啊?
要求:
1. 配置网络中的各台设备,包括设备名、特权模式密码、开启Telnet功能
2. 配置VLAN、Trunk、RIP路由,实现全网互通
3. 配置ACL,允许vlan10用户访问FTP服务器,不允许vlan20用户访问.
如上图所示:
A. 各接口连线如上图所示
其中PC1和PC 4和FTPserver用桥接PC,PC2,3用虚拟PC模拟
B.各接口IP地址规划方案:
交换机名称 F0/0接口地址|vlan F0/1接口地址/vlan F0/2接口地址/vlan F0/3接口地址/vlan
SW1 192.1.1.10/24 |10 无 192.1.2.10/24 |20 无
SW2 192.1.3.10/24 无 192.1.1.20/24 |10 192.1.2.20/24 |20
交换机名称 F0/0接口地址 F1/0接口地址
R1 192.1.5.1/24 192.1.4.20/24
R2 192.1.3.20/24 192.1.4.10/24
C.vlan IP地址
vlan名称 网关IP
Vlan10 192.1.1.1/24
Vlan20 192.1.2.1/24
C.虚拟PC IP地址
PC1:192.1.1.10/24 GW:192.1.1.1
PC2:192.1.2.10/24 GW:192.1.2.1
PC3:192.1.1.20/24 GW:192.1.1.1
PC4:192.1.2.20/24 GW:192.1.2.1
FTPserver:2.1.5.10/24 GW:2.1.5.1
1.配置网络中的各台设备,包括设备名、特权模式密码、开启Telnet功能
SW1:
en
conf t
no ip domain lookup
line console 0
exec-t 0 0
logg sync
exit
ho SW1
enable secret cisco
end
conf t
line vty 0 3
password cisco
login
exit
do show running-config
SW2:
en
conf t
no ip domain lookup
line console 0
exec-t 0 0
logg sync
exit
ho SW2
enable secret cisco
exit
show running-config
R1:
en
conf t
no ip domain lookup
line console 0
exec-t 0 0
logg sync
exit
ho R1
enable secret cisco
end
conf t
line vty 0 3
password cisco
login
exit
do show running-config
R2:
en
conf t
no ip domain lookup
line console 0
exec-t 0 0
logg sync
exit
ho R2
enable secret cisco
end
conf t
line vty 0 3
password cisco
login
exit
do show running-config
2.vlan间通信
SW1:
end
conf t
int f0/1
switchport mode trunk
end
show int f0/1 switchport
vlan database
vlan 10
vlan 20
exit
conf t
no ip routing
int f0/2
switchport mode access
switchport access vlan 10
spanning-tree portfast
no cdp enable
exit
int f0/3
switchport mode access
switchport access vlan 20
spanning-tree portfast
no cdp enable
exit
show vlan-sw b
SW2:
end
conf t
int f0/1
switchport mode trunk
end
show int f0/1 switchport
vlan database
vlan 10
vlan 20
exit
conf t
no ip routing
int f0/0
switchport mode access
switchport access vlan 10
spanning-tree portfast
no cdp enable
exit
int f0/2
switchport mode access
switchport access vlan 20
no cdp enable
exit
show vlan-sw b
验证vlan内通信
PC1能ping通PC3,PC2能ping通PC4.
SW1:
end
conf t
ip routing
int vlan 10
ip address 192.1.1.1 255.255.255.0
no shutdown
exit
int vlan 20
ip address 192.1.2.1 255.255.255.0
no shutdown
exit
show ip int brief
验证vlan间通信:
PC1,2,3,4能互相ping通.
3.配置各设备端口IP
SW1:
end
conf t
int f0/0
ip address 192.1.3.10 255.255.255.0
full
no shutdown
exit
do sh ip int b
R1:
end
conf t
int f0/0
ip address 192.1.5.1 255.255.255.0
full
no shutdown
exit
int f1/0
ip address 192.1.4.20 255.255.255.0
full
no shutdown
exit
do sh ip int b
R2:
end
conf t
int f0/0
ip address 192.1.3.20 255.255.255.0
full
no shutdown
exit
int f1/0
ip address 192.1.4.10 255.255.255.0
full
no shutdown
exit
do sh ip int b
4.配置RIP,确保全网互通
SW1:
end
conf t
router rip
network 192.1.3.0
exit
do sh ip route
R1:
end
conf t
router rip
network 192.1.4.0
network 192.1.5.0
exit
do sh ip route
R2:
end
conf t
router rip
network 192.1.3.0
network 192.1.4.0
exit
do sh ip route
5. FTPserver服务器允许vlan10用户访问,禁止vlan20用户访问。
R1:
end
conf t
ip access-list extended R1
deny ip 192.1.2.0 0.0.0.255 192.1.5.0 0.0.0.255
permit ip 192.1.1.0 0.0.0.255 any
exit
int f0/0
ip access-group R1 out
exit
do sh ip int f0/0
do sh access-list
do wr
|
-
配置图
|