Sie sind auf Seite 1von 7

NAT , PAT ir DHCP konfigūravimas

ISP

Router#configure terminal
Router(config)#hostname ISP
ISP(config)#enable password cisco
ISP(config)#enable secret class
ISP(config)#line console 0
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#line vty 0 4
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#interface loopback 0
ISP(config-if)#ip add 172.16.1.1 255.255.255.255
ISP(config-if)#no shutdown
ISP(config-if)#exit
ISP(config)#interface serial 0
ISP(config-if)#ip add 10.0.0.15 255.255.255.128
ISP(config-if)#clock rate 64000
ISP(config)#ip route 10.0.0.0 255.255.255.0 10.0.0.14
ISP(config)#end
ISP#copy running-config startup-config
Destination filename [startup-config]?[Enter]

Gateway
Router#configure terminal
Router(config)#hostname Gateway
Gateway(config)#enable password cisco
Gateway(config)#enable secret class
Gateway(config)#line console 0
Gateway(config-line)#password cisco
Gateway(config-line)#login
Gateway(config-line)#exit
Gateway(config)#line vty 0 4
Gateway(config-line)#password cisco
Gateway(config-line)#login
Gateway(config-line)#exit

Gateway(config)#fastethernet 0/0 sąsaja jungiama prie komutatoriaus


Gateway(config-if)#ip add 192.168.2.2 255.255.255.0
Gateway(config-if)#no shutdown
Gateway(config-if)#exit

Gateway(config)#fastethernet 0/1 sąsaja jungiama prie Trendnet maršrutizatoriaus


Gateway(config-if)#ip add 192.168.1.2 255.255.255.0
Gateway(config-if)#no shutdown
Gateway(config-if)#exit

Gateway(config)#interface serial 0
Gateway(config-if)#ip add 10.0.0.14 255.255.255.128
Gateway(config-if)#no shutdown
Gateway(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.15

Gateway NAT configuration

Gateway#configure terminal
Gateway(config)#ip nat pool public-access 192.168.2.1 192.168.2.20 netmask
255.255.255.224
Gateway(config)#access-list 1 permit 192.168.2.0 0.0.0.255
Gateway(config)#ip nat inside source list 1 pool public-access
Gateway(config)#interface fastethernet 0/0
Gateway(config-if)#ip nat inside
Gateway(config-if)#interface fastethernet 0/1
Gateway(config-if)#ip nat outside
Gateway(config-if)#exit
Gateway(config)#exit
Gateway#

Gateway PAT configuration


Gateway#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Gateway(config)#access-list 1 permit 192.168.2.0 0.0.0.255
Gateway(config)#ip nat inside source list 1 interface fastethernet 0/0 overload
Gateway(config)#interface fa0/0
Gateway(config-if)#ip nat inside
Gateway(config-if)#exit
Gateway(config)#interface fastethernet 0/1
Gateway(config-if)#ip nat outside
Gateway(config-if)#exit
Gateway(config)#exit
Gateway#copy running-config startup-config

Gateway NAT Configuration (Static)

Gateway#configure terminal

Gateway(config)#ip nat pool public_access 192.168.2.1 192.168.2.20 netmask


255.255.255.224
Gateway(config)#access-list 1 permit 192.168.2.0 0.0.0.255
Gateway(config)#ip nat inside source list 1 pool public_access
Gateway(config)#interface fa0/0
Gateway(config-if)#ip nat inside
Gateway(config-if)#interface fastethernet 0/1
Gateway(config-if)#ip nat outside
Gateway(config-if)#exit
Gateway(config)#ip nat inside source static 192.168.2.2 10.0.0.14
Gateway(config)#exit

Patikra

Gateway#show ip nat translations

Gateway#show ip nat statistics

Gateway#debug ip nat
Gateway#configure terminal
Gateway(config)#interface serial 0/0
Gateway(config-if)#ip nat outside
exit
Gateway#undebug all
DHCP configuration

Campus
Router#configure terminal
Router(config)#hostname campus
campus(config)#enable password cisco
campus(config)#enable secret class
campus(config)#line console 0
campus(config-line)#password cisco
campus(config-line)#login
campus(config-line)#exit
campus(config)#line vty 0 4
campus(config-line)#password cisco
campus(config-line)#login
campus(config-line)#exit
campus(config)#interface fastethernet 0/0
campus(config-if)#ip address 172.16.12.1 255.255.255.0
campus(config-if)#no shutdown
campus(config-if)#exit
campus(config)#interface serial 0/0
campus(config-if)#ip address 172.16.1.6 255.255.255.252
campus(config-if)#clock rate 64000
campus(config-if)#no shutdown
campus(config-if)#exit
campus(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.5
campus(config-if)#exit
campus#copy running-config startup-config
Campus DHCP configuration
campus#configure terminal
campus(config)#ip dhcp pool campus
campus(dhcp-config)#network 172.16.12.0 255.255.255.0
campus(dhcp-config)#default-router 172.16.12.1
campus(dhcp-config)#dns-server 172.16.1.2
campus(dhcp-config)#domain-name foo.com
campus(dhcp-config)#netbios-name-server 172.16.1.10
campus(dhcp-config)#ip dhcp excluded-address 172.16.12.1 172.16.12.10
campus(dhcp-config)#exit
campus(config)#exit
campus#copy running-config startup-config
ISP
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname ISP
ISP(config)#enable password cisco
ISP(config)#enable secret class
ISP(config)#line console 0
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#line vty 0 4
ISP(config-line)#password cisco
ISP(config-line)#login
ISP(config-line)#exit
ISP(config)#interface loopback 0
ISP(config-if)#ip address 172.16.13.1 255.255.255.0
ISP(config-if)#no shutdown
ISP(config-if)#exit
ISP(config)#interface serial 0/0
ISP(config-if)#ip address 172.16.1.5 255.255.255.252
ISP(config-if)#no shutdown
ISP(config-if)#exit
ISP(config)#ip route 172.16.12.0 255.255.255.0 172.16.1.6
ISP(config)#exit
ISP#copy running-config startup-config

To configure the campus LAN pool, use the following commands:

campus(config)#ip dhcp pool campus


campus(dhcp-config)#network 172.16.12.0 255.255.255.0
campus(dhcp-config)#default-router 172.16.12.1
campus(dhcp-config)#dns-server 172.16.1.2
campus(dhcp-config)#domain-name foo.com
campus(dhcp-config)#netbios-name-server 172.16.1.10

campus(config)#ip dhcp excluded-address 172.16.12.1 172.16.12.11

campus#show ip dhcp binding


Helper address configuration

Remote router configuration

Router#configure terminal
Router(config)#hostname remote
remote(config)#enable password cisco
remote(config)#enable secret class
remote(config)#line console 0
remote(config-line)#password cisco
remote(config-line)#login
remote(config-line)#exit
remote(config)#line vty 0 4
remote(config-line)#password cisco
remote(config-line)#login
remote(config-line)#exit
remote(config)#interface fastethernet 0/0
remote(config-if)#ip address 172.16.13.1 255.255.255.0
remote(config-if)#no shutdown
remote(config-if)#exit
remote(config)#interface serial 0/0
remote(config-if)#ip address 172.16.1.5 255.255.255.252
remote(config-if)#no shutdown
remote(config-if)#exit
remote(config)#router ospf 1
remote(config-router)#network 172.16.1.0 0.0.0.255 area 0
remote(config-router)#network 172.16.13.0 0.0.0.255 area 0
remote(config-router)#end
remote#copy running-config startup-config

Campus router configuration


Router#configure terminal
Router(config)#hostname campus
campus(config)#enable password cisco
campus(config)#enable secret class
campus(config)#line console 0
campus(config-line)#password cisco
campus(config-line)#login
campus(config-line)#exit
campus(config)#line vty 0 4
campus(config-line)#password cisco
campus(config-line)#login
campus(config-line)#exit
campus(config)#interface fastethernet 0/0
campus(config-if)#ip address 172.16.12.1 255.255.255.0
campus(config-if)#no shutdown
campus(config-if)#exit
campus(config)#interface serial 0/0
campus(config-if)#ip address 172.16.1.6 255.255.255.252
campus(config-if)#clock rate 56000
campus(config-if)#no shutdown
campus(config-if)#exit
campus(config)#router ospf 1
campus(config-router)#network 172.16.1.0 0.0.0.255 area 0
campus(config-router)#network 172.16.12.0 0.0.0.255 area 0
campus(config-router)#end
campus#copy running-config startup-config

DHCP pool configurations


Campus pool
campus(config)#ip dhcp pool campus
campus(dhcp-config)#network 172.16.12.0 255.255.255.0
campus(dhcp-config)#default-router 172.16.12.1
campus(dhcp-config)#dns-server 172.16.12.2
campus(dhcp-config)#domain-name foo.com
campus(dhcp-config)#netbios-name-server 172.16.12.10
campus(dhcp-config)#exit
Remote pool
campus(config)#ip dhcp pool remote
campus(dhcp-config)#network 172.16.13.0 255.255.255.0
campus(dhcp-config)#default-router 172.16.13.1
campus(dhcp-config)#dns-server 172.16.12.2
campus(dhcp-config)#domain-name foo.com
campus(dhcp-config)#netbios-name-server 172.16.12.10
campus(dhcp-config)#exit
campus(config)#ip dhcp excluded-address 172.16.12.1 172.16.12.10
campus(config)#ip dhcp excluded-address 172.16.13.1 172.16.13.10
campus(config)#exit
campus#copy running-config startup-config
Remote helper address configuration
remote#configure terminal
remote(config)#interface fa0/0
remote(config-if)#ip helper-address 172.16.12.1
remote(config-if)#exit
remote(config)#exit
remote#copy running-config startup-config