题目介绍

如图所示
如图所示为一家公司接入公网的拓扑图,A公司为单核心交换机单出口网络。请按要求配置完成Internet接入:
1、给交换机SW1划分三个VLAN,分别VLAN10、VLAN20和VLAN100。VLAN10名字叫sale,VLAN20名字叫office,VLAN100名字叫server。接口F0/1在VLAN10,接口F0/11在VLAN20,接口F0/21在VLAN100。
2、交换机SW1的VLAN10接口IP是192.168.10.1,VLAN20接口IP是192.168.20.1,VLAN100接口IP是192.168.100.1。接口g0/1工作在三层,IP地址是192.168.12.1/24,接口g0/2工作在三层,IP地址是192.168.13.1/24。
3、给交换机SW2划分两个VLAN,分别VLAN30和VLAN40。VLAN30名字it,VLAN40名字叫info。接口F0/1在VLAN30,接口F0/11在VLAN40。
4、交换机SW2的VLAN30接口IP是192.168.30.1,VLAN40接口IP是192.168.40.1。接口g0/1工作在三层,IP地址是192.168.12.2/24,接口g0/2工作在三层,IP地址是192.168.23.2/24。
5、交换机SW3的g0/1、g0/2、f0/1、f0/21工作在三层模式,IP地址分别为:
g0/1:192.168.13.2/24
g0/2:192.168.23.1/24
f0/1:192.168.1.2/24
f0/21:192.168.200.1/24
6、路由器TelR接入电信网络的IP地址是:182.16.19.2/24。
7、内网采用OSPF实现互联互通。OSPF进程号为1,要求都在区域0内运行OSPF。
8、各设备配置默认路由以便接入Internet。
9、配置R1,允许内部所有网络主机通过PAT都可以接入互联网,访问控制列表编号设为1,不采用地址池,采用f0/0的端口复用技术。
10、为了方便测试互通,Internet上有DNS服务器182.16.11.10,有WEB服务器http://www.news.com,还有测试服务器182.16.50.10。内网测试服务器192.168.100.0和192.168.200.10。
实验开始

刚开始给了一个外网,开始搭建环境
现在模拟器中布置好设备其中
PC1 IP 192.168.10.2 255.255.255.0 192.168.10.1
PC2 IP 192.168.20.2 255.255.255.0 192.168.20.1
PC3 IP 192.168.30.2 255.255.255.0 192.168.30.1
PC4 IP 192.168.40.2 255.255.255.0 192.168.40.1
Server0 IP 192.168.100.2 255.255.255.0 192.168.100.1
Server1 IP 192.168.200.2 255.255.255.0 192.168.200.1
SW1配置
先看清楚配置需要
Vlan 10 Name sale IP 192.168.10.1 255.255.255.0
Vlan 20 Name office IP 192.168.20.1 255.255.255.0
Vlan 100 Name server IP 192.168.100.1 255.255.255.0
G0/1 IP 192.168.12.1 255.255.255.0
G0/2 IP 192.168.13.1 255.255.255.0
F0/1 Vlan 10
F0/11 Vlan 20
F0/21 Vlan 100
需要的操作
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW1 //三层交换机的名字
SW1(config)#vlan 10
SW1(config-vlan)#name sale //给vlan名字
SW1(config-vlan)#exit
SW1(config)#vlan 20
SW1(config-vlan)#name office //给vlan名字
SW1(config-vlan)#exit
SW1(config)#vlan 100
SW1(config-vlan)#name server //给vlan名字
SW1(config-vlan)#exit
SW1(config)#interface vlan 10
SW1(config-if)#ip address 192.168.10.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface vlan 20
SW1(config-if)#ip address 192.168.20.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface vlan 100
SW1(config-if)#ip address 192.168.100.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface fastEthernet 0/1
SW1(config-if)#switchport access vlan 10
SW1(config-if)#exit
SW1(config)#interface fastEthernet 0/11
SW1(config-if)#switchport access vlan 20
SW1(config-if)#exit
SW1(config)#interface fastEthernet 0/21
SW1(config-if)#switchport access vlan 100
SW1(config-if)#exit
SW1(config)#interface gigabitEthernet 0/1
SW1(config-if)#no switchport
SW1(config-if)#ip address 192.168.12.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#interface gigabitEthernet 0/2
SW1(config-if)#no switchport
SW1(config-if)#ip address 192.168.13.1 255.255.255.0
SW1(config-if)#exit
SW1(config)#ip routing
SW1(config)#router ospf 1
SW1(config-router)#network 192.168.10.0 0.0.0.255
SW1(config-router)#network 192.168.10.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.20.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.100.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.12.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.13.0 0.0.0.255 area 0
SW1(config-router)#exit
SW2配置
先看清楚配置需要
Vlan 30 Name it IP 192.168.30.1 255.255.255.0
Vlan 40 Name info IP 192.168.40.1 255.255.255.0
G0/1 IP 192.168.12.2 255.255.255.0
G0/2 IP 192.168.23.2 255.255.255.0
F0/1 Vlan 30
F0/11 Vlan 40
需要的操作
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW2 //三层交换机的名字
SW2(config)#vlan 30
SW2(config-vlan)#name it //给vlan名字
SW2(config-vlan)#exit
SW2(config)#vlan 40
SW2(config-vlan)#name info //给vlan名字
SW2(config-vlan)#exit
SW2(config)#interface vlan 30
SW2(config-if)#ip address 192.168.30.1 255.255.255.0
SW2(config-if)#exit
SW2(config)#interface vlan 40
SW2(config-if)#ip address 192.168.40.1 255.255.255.0
SW2(config-if)#exit
SW2(config)#interface fastEthernet 0/1
SW2(config-if)#switchport access vlan 30
SW2(config-if)#exit
SW2(config)#interface fastEthernet 0/11
SW2(config-if)#switchport access vlan 40
SW2(config-if)#exit
SW2(config)#interface gigabitEthernet 0/1
SW2(config-if)#no switchport
SW2(config-if)#ip address 192.168.12.2 255.255.255.0
SW2(config-if)#exit
SW2(config)#interface gigabitEthernet 0/2
SW2(config-if)#no switchport
SW2(config-if)#ip address 192.168.23.2 255.255.255.0
SW2(config-if)#exit
SW2(config)#ip routing
SW2(config)#router ospf 1
SW2(config-router)#network 192.168.30.0 0.0.0.255 area 0
SW2(config-router)#network 192.168.40.0 0.0.0.255 area 0
SW2(config-router)#network 192.168.23.0 0.0.0.255 area 0
SW2(config-router)#network 192.168.12.0 0.0.0.255 area 0
SW2(config-router)#exit
SW3配置
先看清楚配置需要
G0/1 192.168.13.2 255.255.255.0
G0/2 192.168.23.1 255.255.255.0
F0/1 192.168.1.2 255.255.255.0
F0/21 192.168.200.1 255.255.255.0
需要的操作
Switch>enable
Switch#configure terminal
Switch(config)#hostname SW3 //三层交换机的名字
SW3(config)#interface fastEthernet 0/1
SW3(config-if)#no switchport
SW3(config-if)#ip address 192.168.1.2 255.255.255.0
SW3(config-if)#exit
SW3(config)#interface fastEthernet 0/21
SW3(config-if)#no switchport
SW3(config-if)#ip address 192.168.200.1 255.255.255.0
SW3(config-if)#exit
SW3(config)#interface gigabitEthernet 0/1
SW3(config-if)#no switchport
SW3(config-if)#ip address 192.168.13.2 255.255.255.0
SW3(config-if)#exit
SW3(config)#interface gigabitEthernet 0/2
SW3(config-if)#no switchport
SW3(config-if)#ip address 192.168.23.1 255.255.255.0
SW3(config-if)#exit
SW3(config)#ip routing
SW3(config)#router ospf 1
SW3(config-router)#network 192.168.13.0 0.0.0.255 area 0
SW3(config-router)#network 192.168.23.0 0.0.0.255 area 0
SW3(config-router)#network 192.168.1.0 0.0.0.255 area 0
SW3(config-router)#network 192.168.200.0 0.0.0.255 area 0
SW3(config-router)#exit
TelR配置
先看清楚配置需要
F0/0 IP 182.16.19.2 255.255.255.0
F0/1 IP 192.168.1.1 255.255.255.0
需要的操作
Router>enable
Router#configure terminal
Router(config)#hostname TelR //路由器的名字
TelR(config)#interface fastEthernet 0/1
TelR(config-if)#ip address 192.168.1.1 255.255.255.0
TelR(config-if)#ip nat outside //给对互联网方面设置口
TelR(config-if)#no shutdown
TelR(config-if)#exit
TelR(config)#interface fastEthernet 0/0
TelR(config-if)#ip address 182.16.19.2 255.255.255.0
TelR(config-if)#ip nat inside //给内网接口设置口
TelR(config-if)#no shutdown
TelR(config-if)#exit
TelR(config)#router ospf 1
TelR(config-router)#network 192.168.1.0 255.255.255.0 area 0
TelR(config-router)#network 182.16.19.0 255.255.255.0 area 0
TelR(config-router)#exit
TelR(config)#access-list 1 permit any
TelR(config)#ip nat inside source list 1 interface fastEthernet 0/0 overload //用f0/0的端口复用技术
配置结果

就能成功了。不过不是最后的结果最后一段是要访问Web服务器,我们看看要求
为了方便测试互通,Internet上有DNS服务器182.16.11.10,有WEB服务器http://www.news.com,还有测试服务器182.16.50.10。内网测试服务器192.168.100.0和192.168.200.10。
DNS配置

最终成果

到这里就成功配置啦。可能中间有很多问题,如果有误请各位大佬留言,我马上修改谢谢
版权声明:本文为pone2233原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。