Konfiguracja NAT na routerze – jedynie jeden VLAN spośród kilku ma możliwość komunikacji z siecią Internet przy wykorzystaniu PAT
Zadanie do wykonania będzie się opierać na zasymulowaniu ruchu Internet w postaci adresu loopback 0 1.1.1.1/8. Spośród dwóch sieci VLAN: VLAN10 i VLAN15 jedynie możliwość komunikacji będzie z siecią Internet z wykorzystaniem NAT PAT będzie miała sieć VLAN10. W tym celu zostanie użyty PAT Overload.
Konfigurację w formie video znajdziesz TUTAJ 🙂
Topologia użyta w zadaniu

Opis topologii
- Trzy routery: Router0, Router1, ISP(jako sieć internet zasymulowany adres Loopback 1.1.1.1)
- Dwie stacje robocze w różnych VLANACH (VLAN10 i VLAN15)
- Switch
Realizowanie zadania
- Przydzielenie adresów IP do wszystkich urządzeń w sieci
- Wprowadzenie wymaganych tras routingu na routerach przy użyciu m.in. OSPF i wprowadzeniu trasy statycznej
- Konfiguracja podinterfejsów na Router0 i Switch0
- Użycie jedynie dla sieci VLAN10 NAT PAT overload służącego do translacji adresu


Stacja PC0 nie ma możliwości komunikacji z siecią Internet, należy skonfigurować urządzenia.
Konfiguracja urządzeń
- Switch0
- Router0
- Router1
- ISP (Router, który ma zasymulować sieć Internet)
Switch0
Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10Switch(config-vlan)#name nowySwitch(config-vlan)#exSwitch(config)#vlan 15Switch(config-vlan)#name testSwitch(config-vlan)#exSwitch(config)#vlanSwitch(config)#vlan 99Switch(config-vlan)#name siec99Switch(config-vlan)#exSwitch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#exSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 15Switch(config-if)#exSwitch(config)#interface fastEthernet 0/3Switch(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exSwitch(config)#interface vlan 99Switch(config-if)# %LINK-5-CHANGED: Interface Vlan99, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up Switch(config-if)#ip address 172.16.99.1 255.255.255.252Switch(config-if)#exSwitch(config)#interface vlan 10Switch(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up Switch(config-if)#ip address 172.16.10.2 255.255.255.0Switch(config-if)#exSwitch(config)#interface vlan 15Switch(config-if)# %LINK-5-CHANGED: Interface Vlan15, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan15, changed state to up Switch(config-if)#ip address 172.16.15.2 255.255.255.0Switch(config)#ip default-gateway 172.16.99.2Switch(config)#exSwitch# %SYS-5-CONFIG_I: Configured from console by console Switch#conf tEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface fastEthernet 0/3Switch(config-if)#switchport trunk native vlan 99Switch(config-if)#switchport trunk allowed vlan 10,15,99
Router0
Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#interface FastEthernet0/1Router(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up Router(config-if)#ip address 10.32.1.1 255.0.0.0Router(config-if)#ip address 10.32.1.1 255.255.255.252Router(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config-if)#exitRouter(config)#interface FastEthernet0/0Router(config-if)#no shutdownRouter(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)#exRouter(config)#interface fastEthernet 0/0.99Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.99, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.99, changed state to up Router(config-subif)#encapsulation dot1Q 99 nativeRouter(config-subif)#ip address 172.16.99.2 255.255.255.252Router(config-subif)#exRouter(config)#interface fastEthernet 0/0.10Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up Router(config-subif)#encapsulation dot1Q 10Router(config-subif)#ip address 172.16.10.1 255.255.255.0Router(config)#interface fastEthernet 0/0.15Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.15, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.15, changed state to up Router(config-subif)#ip address 172.16.15.1 255.255.255.0% Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN. Router(config-subif)#encapsulation dot1Q 15Router(config-subif)#ip address 172.16.15.1 255.255.255.0Router(config-subif)#exRouter(config)#exRouter# %SYS-5-CONFIG_I: Configured from console by console Router#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#router ospf 1Router(config-router)#router-id 1.1.1.1Router(config-router)#network 10.32.1.1 0.0.0.3 area 0Router(config-router)#network 172.16.99.2 0.0.0.3 area 0Router(config-router)#network 172.16.15.1 0.0.0.255 area 0Router(config-router)#network 172.16.10.1 0.0.0.255 area 0Router(config-router)# 00:18:43: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/1 from LOADING to FULL, Loading Done Router(config-router)#ex
Router1
Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#router ospf 1Router(config-router)#router-id 3.3.3.3Router(config-router)#network 10.32.1.2 0.0.0.3 area 0Router(config-router)# 00:18:41: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on FastEthernet0/0 from LOADING to FULL, Loading Done Router(config-router)#exRouter(config)#interface fastEthernet 0/1Router(config-if)#exRouter(config)#router ospf 1Router(config-router)#passive-interface fastEthernet 0/1Router(config-router)#exRouter(config)#ip route 0.0.0.0 0.0.0.0 198.45.45.2Router(config)#router ospf 1Router(config-router)#default-information originateRouter(config-router)#exRouter(config)#interface fastEthernet 0/0Router(config-if)#ip nat insideRouter(config-if)#exRouter(config)#interface fastEthernet 0/1Router(config-if)#ip nat outsideRouter(config-if)#exRouter(config)#ip access-list standard NAT_VLAN10Router(config-std-nacl)#permit 172.16.10.0 0.0.0.255Router(config-std-nacl)#exitRouter(config)#ip nat inside source list NAT_VLAN10 interface fastEthernet 0/1 overloadRouter(config)#exRouter# %SYS-5-CONFIG_I: Configured from console by console Router#show ip nat translationsPro Inside global Inside local Outside local Outside global icmp 198.45.45.1:30 172.16.10.10:30 1.1.1.1:30 1.1.1.1:30 icmp 198.45.45.1:31 172.16.10.10:31 1.1.1.1:31 1.1.1.1:31 icmp 198.45.45.1:32 172.16.10.10:32 1.1.1.1:32 1.1.1.1:32 icmp 198.45.45.1:33 172.16.10.10:33 1.1.1.1:33 1.1.1.1:33
ISP (router ma zasymulować sieć Internet)
Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#ip route 10.32.1.0 255.255.255.0 198.45.45.1Router(config)#ip route 172.16.0.0 255.255.0.0 198.45.45.1

Konfiguracja NAT PAT na Router1
Router1 został odpowiednio skonfigurowany dla NAT PAT Overload. Komunikacja z zewnętrznym adresem z PC0 do sieci Internet odbywa się z przetłumaczeniem adresu.

