Cisco三层vlan与路由配置
2017-07-01 08:21
645 查看
要求整个网络可以访问互联网,使用NAT转换2017年6月30日14:13
1、用Internet路由器模仿公网路由,配置如下 Router>enableRouter#config tEnter configurationcommands, one per line. End with CNTL/Z.Router(config)#inters1/0Router(config-if)#ipadd 1.1.1.1 255.255.255.0Router(config-if)#clockrate 6400Router(config-if)#noshutdown模拟公网路由器配置完成 2、配置企业路由器 配置连接公网的接口IP地址把接口定义为outside Router>enableRouter#config tEnter configurationcommands, one per line. End with CNTL/Z.Router(config)#inters1/1Router(config-if)#ipadd 1.1.1.2 255.255.255.0Router(config-if)#noshutdown Router(config-if)#%LINK-5-CHANGED:Interface Serial1/1, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Serial1/1, changed state to up Router(config-if)#ip nat outside 配置连接三层交换机接口IP地址把接口定义为insideRouter(config)#interf0/0Router(config-if)#ipadd 172.16.1.2 255.255.255.0Router(config-if)#noshutdown Router(config-if)#%LINK-5-CHANGED:Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#ip nat inside 配置acl访问控制列表,不配置无法访问通过路由访问公网(这里特别重要)如果不把所有要允许访问公网的网段配置成允许访问的状态,路由器就会阻止这些网段访问公网Router(config)#access-list10 permit 192.168.1.0 0.0.0.255Router(config)#access-list10 permit 192.168.2.0 0.0.0.255Router(config)#access-list10 permit 192.168.3.0 0.0.0.255 配置NAT地址转换Router(config)#ip natinside source list 10 interface s1/1 overload 3、配置三层交换机 创建一个vlan5用来配置与路由连接的地址,并把f0/1划入vlan5 Switch(config)#vlan 5 Switch(config)#interf0/1Switch(config-if)#switSwitch(config-if)#switchportmoSwitch(config-if)#switchportmode accSwitch(config-if)#switchportmode accessSwitch(config-if)#swacSwitch(config-if)#swaccess vlan 5 配置vlan地址Switch(config-if)#intervlan 5Switch(config-if)#%LINK-5-CHANGED:Interface Vlan5, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan5, changed state to up Switch(config-if)#ipadd 172.16.1.1 255.255.255.0Switch(config-if)#noshutdown 把其它vlan也配置好配置Vlan2Switch(config)#interf0/2Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 2Switch(config-if)#intervlan 2Switch(config-if)#%LINK-5-CHANGED:Interface Vlan2, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan2, changed state to up Switch(config-if)#ipadd 192.168.1.254 255.255.255.0Switch(config-if)#noshutSwitch(config-if)# 配置Vlan3Switch(config-if)#noshutSwitch(config-if)#interf0/3Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 3Switch(config-if)#intervlan 3Switch(config-if)#%LINK-5-CHANGED:Interface Vlan3, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan3, changed state to up Switch(config-if)#ipadd 192.168.2.254 255.255.255.0 配置Vlan4 Switch(config-if)#interf0/4Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 4Switch(config-if)#intervlan 4Switch(config-if)#%LINK-5-CHANGED:Interface Vlan4, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan4, changed state to up Switch(config-if)#ipadd 192.168.3.254 255.255.255.0 配置DHCP服务器 配置vlan2DHCP服务器Switch(config)#ipdhcp pool vlan2Switch(dhcp-config)#default-router192.168.1.254Switch(dhcp-config)#dns-server1.1.1.1Switch(dhcp-config)#network192.168.1.0 255.255.255.0Switch(dhcp-config)#exit 配置vlan3DHCP服务器Switch(config)#ipdhcp pool vlan3Switch(dhcp-config)#default-router192.168.2.254Switch(dhcp-config)#dns-server2.2.2.2Switch(dhcp-config)#network192.168.2.0 255.255.255.0Switch(dhcp-config)#exit 配置vlan4DHCP服务器Switch(config)#ipdhcp pool vlan4Switch(dhcp-config)#default-router192.168.3.254Switch(dhcp-config)#dns-server3.3.3.3Switch(dhcp-config)#network192.168.3.0 255.255.255.0Switch(dhcp-config)#exit 开启三层交换机路由功能 ip routing 到这里所有的vlan间的电脑已经能够相互ping通了,但是还是不能访问互联网,因为路由还没有配置完成
1、用Internet路由器模仿公网路由,配置如下 Router>enableRouter#config tEnter configurationcommands, one per line. End with CNTL/Z.Router(config)#inters1/0Router(config-if)#ipadd 1.1.1.1 255.255.255.0Router(config-if)#clockrate 6400Router(config-if)#noshutdown模拟公网路由器配置完成 2、配置企业路由器 配置连接公网的接口IP地址把接口定义为outside Router>enableRouter#config tEnter configurationcommands, one per line. End with CNTL/Z.Router(config)#inters1/1Router(config-if)#ipadd 1.1.1.2 255.255.255.0Router(config-if)#noshutdown Router(config-if)#%LINK-5-CHANGED:Interface Serial1/1, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Serial1/1, changed state to up Router(config-if)#ip nat outside 配置连接三层交换机接口IP地址把接口定义为insideRouter(config)#interf0/0Router(config-if)#ipadd 172.16.1.2 255.255.255.0Router(config-if)#noshutdown Router(config-if)#%LINK-5-CHANGED:Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)#ip nat inside 配置acl访问控制列表,不配置无法访问通过路由访问公网(这里特别重要)如果不把所有要允许访问公网的网段配置成允许访问的状态,路由器就会阻止这些网段访问公网Router(config)#access-list10 permit 192.168.1.0 0.0.0.255Router(config)#access-list10 permit 192.168.2.0 0.0.0.255Router(config)#access-list10 permit 192.168.3.0 0.0.0.255 配置NAT地址转换Router(config)#ip natinside source list 10 interface s1/1 overload 3、配置三层交换机 创建一个vlan5用来配置与路由连接的地址,并把f0/1划入vlan5 Switch(config)#vlan 5 Switch(config)#interf0/1Switch(config-if)#switSwitch(config-if)#switchportmoSwitch(config-if)#switchportmode accSwitch(config-if)#switchportmode accessSwitch(config-if)#swacSwitch(config-if)#swaccess vlan 5 配置vlan地址Switch(config-if)#intervlan 5Switch(config-if)#%LINK-5-CHANGED:Interface Vlan5, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan5, changed state to up Switch(config-if)#ipadd 172.16.1.1 255.255.255.0Switch(config-if)#noshutdown 把其它vlan也配置好配置Vlan2Switch(config)#interf0/2Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 2Switch(config-if)#intervlan 2Switch(config-if)#%LINK-5-CHANGED:Interface Vlan2, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan2, changed state to up Switch(config-if)#ipadd 192.168.1.254 255.255.255.0Switch(config-if)#noshutSwitch(config-if)# 配置Vlan3Switch(config-if)#noshutSwitch(config-if)#interf0/3Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 3Switch(config-if)#intervlan 3Switch(config-if)#%LINK-5-CHANGED:Interface Vlan3, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan3, changed state to up Switch(config-if)#ipadd 192.168.2.254 255.255.255.0 配置Vlan4 Switch(config-if)#interf0/4Switch(config-if)#swmo accSwitch(config-if)#swacc vlan 4Switch(config-if)#intervlan 4Switch(config-if)#%LINK-5-CHANGED:Interface Vlan4, changed state to up %LINEPROTO-5-UPDOWN:Line protocol on Interface Vlan4, changed state to up Switch(config-if)#ipadd 192.168.3.254 255.255.255.0 配置DHCP服务器 配置vlan2DHCP服务器Switch(config)#ipdhcp pool vlan2Switch(dhcp-config)#default-router192.168.1.254Switch(dhcp-config)#dns-server1.1.1.1Switch(dhcp-config)#network192.168.1.0 255.255.255.0Switch(dhcp-config)#exit 配置vlan3DHCP服务器Switch(config)#ipdhcp pool vlan3Switch(dhcp-config)#default-router192.168.2.254Switch(dhcp-config)#dns-server2.2.2.2Switch(dhcp-config)#network192.168.2.0 255.255.255.0Switch(dhcp-config)#exit 配置vlan4DHCP服务器Switch(config)#ipdhcp pool vlan4Switch(dhcp-config)#default-router192.168.3.254Switch(dhcp-config)#dns-server3.3.3.3Switch(dhcp-config)#network192.168.3.0 255.255.255.0Switch(dhcp-config)#exit 开启三层交换机路由功能 ip routing 到这里所有的vlan间的电脑已经能够相互ping通了,但是还是不能访问互联网,因为路由还没有配置完成
相关文章推荐
- Cisco三层vlan与路由配置
- Cisco 三层交换 实现vlan间路由与dhcp配置
- 三层交换实现vlan间路由与dhcp配置 推荐
- Cisco思科三层交换典型VLAN配置
- 三层交换实现vlan间路由与dhcp配置
- Cisco 3560的Inter vlan间路由配置
- Cisco交换基础路由配置:交换机怎么设置实现三层交换功能
- cisco 3550 三层交换机 vlan间路由配置实例
- cisco三层交换和多个vlan通信配置实例
- cisco 3550 三层交换机vlan间路由配置实例
- cisco 三层交换配置vlan详细报告
- cisco-sw-三层交换-VLAN间路由协议
- 两层交换机上划分VLAN借三层交换机路由功能实现跨网段访问(Cisco Packer Tracer 模拟器)
- 【基础】使用华为三层交换实现vlan间路由配置实战
- cisco 3560 三层交换机vlan间路由配置实例 ***********
- Cisco 3560的Inter vlan间路由配置
- 在一台三层交换上,通过配置dhcp和路由实现不同VLAN相互通信
- Cisco 3560的Inter vlan间路由配置
- Vlan配置详解之三层交换
- VLAN的通讯:单臂路由配置实例