Cisco switch, inter-vlan routing, and nat address translation

Source: Internet
Author: User
Tags cisco switch

I am eager for the first time to switch between vlan routing and nat addresses of Cisco switches. I am very energetic and have an undefeated spirit. I am ready to continue to answer questions during multiple rounds of interviews. My little brother squashed his eyes and took out the bottom of the press box: If my company has two Internet interfaces, A and B, respectively. The following vswitch divides multiple VLANs. One of the VLANs goes through the-line and the other goes through the B-line. How can this problem be achieved through technology, working like this, I walked by and came home to find a solution. Please refer to the following configuration. objective: To build A vswitch with three VLANs: vlan10, vlan20, and vlan30, where vlan10 follows the-line vlan30, and B-line 2950 to configure the inter-vlan routing step: R1 (confi g) # int s1/0R1 (confi g-if) # ip add 172.16.1.1 255.255.255.0R1 (confi g-if) # no shutR1 (confi g) # int s1/1R1 (confi g-if) # ip add 172.16.2.1 255.255.255.0R1 (confi g-if) # no shutR1 (confi g) # int e0/0R1 (confi g-if) # no shutR1 (confi g) # int e0/0.1R1 (confi g-subif) # encapsulation dot1q 10R1 (confi g-subif) # ip addr 192.168.1.1 255.255.255.0R1 (confi g) # intE0/0.2R1 (confi g-subif) # encapsulation dot1q 20R1 (confi g-subif) # ip addr 192.168.2.1 255.255.0r1 (confi g) # intE0/0.3R1 (confi g-subif) # encapsulation dot1q 30R1 (confi g-subif) # ip addr 192.168.2.1 255.255.255.0R1 (confi g) # ip nat pool tian 172.16.1.1 172.16.1.1 netmask 255.255.255.0R1 (confi g) # access-list 10 permit 192.168.1.0 0.0.255r1 (confi g) # access-list 10 deny anyR1 (confi g) # ip nat inside source list 10 pool tian overloadR1 (confi g) # int s1/0R1 (confi g-if) # ip nat outsideR1 (confi g) # int e0/0.1R1 (confi g-if) # ip nat insideR1 (confi g) # ip nat pool chen 172.16.2.1 172.16.2.1 netmask limit 255.255.0r1 (confi g) # access-list 11 permit 192.168.2.0 0.0.255r1 (confi g) # access-list 11 permit 192.168.3.0 0.0.255r1 (confi g) # access-list 11 deny anyR1 (confi g) # ip nat inside source list 11 pool chen overloadR1 (confi g) # int s1/1R1 (confi g-if) # ip nat outsideR1 (confi g) # int e0/0.2R1 (confi g-if) # ip nat outsideR1 (confi g) # int e0/0.3R1 (confi g-if) # ip nat outside switch configuration step Sw1 (config) # int fa0/0Sw1 (config-if) # switchport mode trunkSw1 (vlan) # vlan 10 name gongchengbuSw1 (vlan) # vlan 20 name caiwubuSw1 (vlan) # vlan 20 name yuangongbuSw1 (config) # int fa0/1Sw1 (config-if) # switchport access vlan 10Sw1 (config) # int fa0/2Sw1 (config-if) # switchport access vlan 20Sw1 (config) # int fa0/3Sw1 (config-if) # switchport access vlan 30Sw1 (config) # int range f0/0-12Sw1 (config-range) # no shutPC machine configuration steps: PC1: C: & gt; ip 192.168.1.2 192.168.1.1PC2: C: & gt; ip 192.168.2.2 192.168.2.1PC3: c: & gt; ip 192.168.3.2 192.168.3.1: pc1 can only be pinged to 172.16.1.2, but not 172.16.2.2. pc2 can only be pinged to 172.16.2.2, not 172.16.1.2. pc3 can be pinged to 172.16.2.2 or 172.16.1.2.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.