三层交换机多VLAN+NAT上网实验(有拓扑和配置文件)三层交换机多VLAN+NAT上网实验(有拓扑和配置文件)
三层交换机多VLAN+NAT上网实验配置(有拓扑和配置文件)
router2
s1/0ISP
s1/0router1172.16.0.2/24
Fe0/0192.168.0.1/24
三层交换机Fe1/1192.168.0.2/24创建vlan10 vlan20
Si
Fe1/3Fe1/4
VLAN20VLAN10
PC1PC1IP:192.168.10.10/24IP:192.168.20.10/24
GW 192.168.10.1GW 192.168.20.1
...
三层交换机多VLAN+NAT上网实验(有拓扑和配置文件)
三层交换机多VLAN+NAT上网实验配置(有拓扑和配置文件)
router2
s1/0ISP
s1/0router1172.16.0.2/24
Fe0/0192.168.0.1/24
三层交换机Fe1/1192.168.0.2/24创建vlan10 vlan20
Si
Fe1/3Fe1/4
VLAN20VLAN10
PC1PC1IP:192.168.10.10/24IP:192.168.20.10/24
GW 192.168.10.1GW 192.168.20.1
说明:
适用中心三层交换机划多VLAN(间不能互访),VLAN通过路由NAT上网
配置文件如下:
router1#show run
Building configuration...
Current configuration : 745 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname router1 !
boot-start-marker boot-end-marker !
!
no aaa new-model memory-size iomem 5 !
!
ip cef
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 172.16.0.2 255.255.255.0
serial restart-delay 0 !
interface Serial1/1
no ip address
shutdown
serial restart-delay 0 !
interface Serial1/2
no ip address
shutdown
serial restart-delay 0 !
interface Serial1/3
no ip address
shutdown
serial restart-delay 0 !
no ip http server !
control-plane
line con 0
line aux 0
line vty 0 4
!
!
End
router2#show run
Building configuration...
Current configuration : 989 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption !
hostname router2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
!
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0
ip nat inside
ip virtual-reassembly
speed 100
full-duplex
!
interface Serial1/0
ip address 172.16.0.1 255.255.255.0
ip nat outside
ip virtual-reassembly
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0 !
interface Serial1/2
no ip address
shutdown
serial restart-delay 0 !
interface Serial1/3
no ip address
shutdown
serial restart-delay 0 !
ip http server
ip route 192.168.0.0 255.255.0.0 192.168.0.2
!
!
ip nat inside source list 101 interface Serial1/0 overload
!
access-list 101 permit ip 192.168.0.0 0.0.255.255 any
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
End
sw1#show run
Building configuration...
Current configuration : 1284 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption !
hostname sw1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
interface FastEthernet1/0 !
interface FastEthernet1/1
no switchport
ip address 192.168.0.2 255.255.255.0
!
interface FastEthernet1/2 !
interface FastEthernet1/3
switchport access vlan 10
vlan-id dot1q 10
exit-vlan-config
!
!
interface FastEthernet1/4
switchport access vlan 20 !
interface FastEthernet1/5 !
interface FastEthernet1/6
!
interface FastEthernet1/7 !
interface FastEthernet1/8 !
interface FastEthernet1/9 !
interface FastEthernet1/10 !
interface FastEthernet1/11 !
interface FastEthernet1/12 !
interface FastEthernet1/13 !
interface FastEthernet1/14 !
interface FastEthernet1/15 !
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
ip access-group 101 in !
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
no ip http server
ip route 0.0.0.0 0.0.0.0 192.168.0.1
!
!
!
access-list 101 deny ip 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255
access-list 101 permit ip any any
!
!
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
pc1#show run
Building configuration...
Current configuration : 385 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime no service password-encryption !
hostname pc1
!
!
ip subnet-zero
no ip routing
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.10.10 255.255.255.0
no ip route-cache
speed 100
full-duplex
!
ip default-gateway 192.168.10.1
ip classless
ip http server
!
!
line con 0
line aux 0
line vty 0 4
!
End
pc2#show run
Building configuration...
Current configuration : 385 bytes
!
version 12.2
service timestamps debug uptime service timestamps log uptime no service password-encryption !
hostname pc2
!
!
ip subnet-zero
no ip routing
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.20.10 255.255.255.0
no ip route-cache
speed 100
full-duplex
!
ip default-gateway 192.168.20.1 ip classless
ip http server
!
!
line con 0
line aux 0
line vty 0 4
!
end
本文档为【三层交换机多VLAN+NAT上网实验(有拓扑和配置文件)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。