Create a local area network in the LAN

Source: Internet
Author: User


Create a local area network in the LAN

If you live in a dormitory, check if your IP address is 192. 168 .*.*? In general, we simply use a vro or server in the network room to switch the NAT address to the Internet. What if I want to build a small Internet cafe in my dormitory? (The experiment can be done. If this is the case, lead Lei carefully ~)
Today, we will do what the network administrators do in the air-conditioner Room in our dormitory ~
Topology:

Configuration information on the four routers (For details, refer to R0 and R1, because this experiment is mainly used by PAT. At the same time, the interface connecting router R1 to the public network also obtains the IP address through DHCP .) :
Configurations on router R0:
R0 # sh run
Building configuration...
Current configuration: 645 bytes
!
Version 12.4:
No service password-encryption
!
Hostname R0
!
!
Ip ssh version 1
!
!
Interface FastEthernet0/0
Ip address dhcp (automatically obtain IP addresses)
Ip nat outside
Duplex auto
Speed auto
!
Interface FastEthernet0/1
Ip address 192.168.2.254 255.255.255.0
Ip nat inside
Duplex auto
Speed auto
!
Interface Vlan1
No ip address
Shutdown
!
Ip nat inside source list 2 interface FastEthernet0/0 overload
Ip classless
Ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
!
!
Access-list 2 permit 192.168.2.0 0.0.255
!
!
Ip dhcp pool tiger
Network 192.168.2.0 255.255.255.0
Default-router 192.168.2.254
Dns-server 200.1.3.1
!
Line con 0
Line vty 0 4
Login
!
!
End
Configurations on router R1:
R1 # sh run
Building configuration...
Current configuration: 661 bytes
!
Version 12.4:
No service password-encryption
!
Hostname R1
!
!
Ip ssh version 1
!
!
Interface FastEthernet0/0
Ip address 200.1.1.2 255.255.255.0
Ip nat outside
Duplex auto
Speed auto
!
Interface FastEthernet0/1
Ip address 192.168.1.254 255.255.255.0
Ip nat inside
Duplex auto
Speed auto
!
Interface Vlan1
No ip address
Shutdown
!
Ip nat inside source list 1 interface FastEthernet0/0 overload
Ip classless
Ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
!
!
Access-list 1 permit 192.168.1.0 0.0.255
!
!
Ip dhcp pool R1
Network 192.168.1.0 255.255.255.0
Default-router 192.168.1.254
Dns-server 200.1.3.1
!
Line con 0
Line vty 0 4
Login
!
!
End
Vror2 R2 settings (the establishment of Dynamic Route r12002 and the establishment of a public network DHCP address pool for R1 to obtain IP addresses ):
R2 # sh run
Building configuration...
Current configuration: 454 bytes
!
Version 12.4:
No service password-encryption
!
Hostname R2
!
!
Ip ssh version 1
!
!
Interface FastEthernet0/0
Ip address 200.1.2.1 255.255.255.0
Duplex auto
Speed auto
!
Interface FastEthernet0/1
Ip address 200.1.1.1 255.255.255.0
Duplex auto
Speed auto
!
Interface Vlan1
No ip address
Shutdown
!
Router rip
Version 2
Network 200.1.1.0
Network 200.1.2.0
No auto-summary
!
Ip classless
!
!
Line con 0
Line vty 0 4
Login
!
!
End
Vror3 R3 configuration (Review r12002 ~) :
R3 # sh run
Building configuration...
Current configuration: 456 bytes
!
Version 12.4:
No service password-encryption
!
Hostname R3
!
!
Ip ssh version 1
!
!
Interface FastEthernet0/0
Ip address 200.1.2.2 255.255.255.0
Duplex auto
Speed auto
!
Interface FastEthernet0/1
Ip address 200.1.3.254 255.255.255.0
Duplex auto
Speed auto
!
Interface Vlan1
No ip address
Shutdown
!
Router rip
Version 2
Network 200.1.2.0
Network 200.1.3.0
No auto-summary
!
Ip classless
!
!
Line con 0
Line vty 0 4
Login
!
!
End
In this experiment, the server serves as both an HTTP server and a DNS server.
Let's take a look at the configuration on DNS:

In the experiment, all hosts use DHCP to obtain their own IP addresses, Gateway addresses, and DNS server addresses ~
IP address of the host in the original LAN:

Host IP address in the dormitory LAN:

Verify:
Find a host PC0 on the LAN 192.168.1.0/24 and open the webpage [url] www.cisco.com [/url:

Find a host PC3 on the LAN 192.168.2.0/24 and open the webpage [url] www.cisco.com [/url:

Successful! (Since then, you are the owner of the dormitory Internet cafe !)
Now, run the command sh ip nat translation on routers R1 and R0 to check the PAT process ~
Result on R1:
R1 # sh ip nat translations
Pro Inside global Inside local Outside global
Udp 200.1.1.2: 1025 192.168.1.1: 1025 200.1.3.1: 53 200.1.3.1: 53
Udp 200.1.1.2: 1026 192.168.1.1: 1026 200.1.3.1: 53 200.1.3.1: 53
Udp 200.1.1.2: 1027 192.168.1.1: 1027 200.1.3.1: 53 200.1.3.1: 53
Udp 200.1.1.2: 1028 192.168.1.1: 1028 200.1.3.1: 53 200.1.3.1: 53
Udp 200.1.1.2: 1035 192.168.1.2: 1035 200.1.3.1: 53 200.1.3.1: 53
Tcp 200.1.1.2: 1024 192.168.1.1: 1024 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1024 192.168.1.1: 1025 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1027 192.168.1.1: 1026 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1027 192.168.1.1: 1027 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1029 192.168.1.1: 1028 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1029 192.168.1.1: 1029 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1031 192.168.1.1: 1030 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1031 192.168.1.1: 1031 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1030 192.168.1.2: 1025 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1025 192.168.1.4: 1025 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1026 192.168.1.4: 1026 200.1.3.1: 80 200.1.3.1: 80
Tcp 200.1.1.2: 1028 192.168.1.4: 1027 200.1.3.1: 80 200.1.3.1: 80
Result on R0:
R0 # sh ip nat translations
Pro Inside global Inside local Outside global
Udp 192.168.1.1: 1025 192.168.2.1: 1025 200.1.3.1: 53 200.1.3.1: 53
Udp 192.168.1.1: 1026 192.168.2.1: 1026 200.1.3.1: 53 200.1.3.1: 53
Udp 192.168.1.1: 1027 192.168.2.1: 1027 200.1.3.1: 53 200.1.3.1: 53
Udp 192.168.1.1: 1028 192.168.2.1: 1028 200.1.3.1: 53 200.1.3.1: 53
Tcp 192.168.1.1: 1024 192.168.2.1: 1025 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1029 192.168.2.1: 1026 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1030 192.168.2.1: 1027 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1031 192.168.2.1: 1028 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1025 192.168.2.3: 1025 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1026 192.168.2.3: 1026 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1027 192.168.2.3: 1027 200.1.3.1: 80 200.1.3.1: 80
Tcp 192.168.1.1: 1028 192.168.2.3: 1028 200.1.3.1: 80 200.1.3.1: 80
If the webpage cannot be opened occasionally, obtain the IP address again ~

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.