cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1014
Views
5
Helpful
10
Replies

NAT not working

Diegoncho
Level 1
Level 1

Good afternoon everyone, yesterday I tried to do a lab to test NAT but it doesn't work for me, any recommendation?
The pc takes ip from vlan 20

TOPOLO.png

///ROUTER//

Router>enable
Router#confi
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#DO SHOW RUN
Building configuration...

Current configuration : 3344 bytes
!
! Last configuration change at 01:12:48 UTC Sun Oct 2 2022
!
version 15.9
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!
!
!
ip dhcp excluded-address 192.168.20.1 192.168.20.10
!
ip dhcp pool delegacion
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
ip address dhcp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/1.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
interface GigabitEthernet0/2
no ip address
shutdown
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/3
no ip address
shutdown
duplex auto
speed auto
media-type rj45
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip nat inside source list 1 interface GigabitEthernet0/0 overload
!
ipv6 ioam timestamp
!
!
access-list 1 permit 192.168.20.0 0.0.0.255
!
control-plane
!
banner exec ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
banner incoming ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
banner login ^C
**************************************************************************
* IOSv is strictly limited to use for evaluation, demonstration and IOS *
* education. IOSv is provided as-is and is not supported by Cisco's *
* Technical Advisory Center. Any use or disclosure, in whole or in part, *
* of the IOSv Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
**************************************************************************^C
!
line con 0
line aux 0
line vty 0 4
login
transport input none
!
no scheduler allocate
!
end

Router(config)#
Router#

 

/////SWITCH////

SWITCH(config)#DO SHOW RUN
Building configuration...

Current configuration : 2729 bytes
!
! Last configuration change at 01:05:47 UTC Sun Oct 2 2022
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SWITCH
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
!
interface GigabitEthernet0/1
switchport access vlan 20
switchport mode access
negotiation auto
!
interface GigabitEthernet0/2
negotiation auto
!
interface GigabitEthernet0/3
negotiation auto
!
ip forward-protocol nd
!
ip http server
ip http secure-server
!
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
!
!
!
!
!
!
control-plane
!
banner exec ^C
IOSv - Cisco Systems Confidential -

Supplemental End User License Restrictions

This IOSv software is provided AS-IS without warranty of any kind. Under no circumstances may this software be used separate from the Cisco Modeling Labs Software that this software was provided with, or deployed or used as part of a production environment.

By using the software, you agree to abide by the terms and conditions of the Cisco End User License Agreement at http://www.cisco.com/go/eula. Unauthorized use or distribution of this software is expressly prohibited.
^C
banner incoming ^C
IOSv - Cisco Systems Confidential -

Supplemental End User License Restrictions

This IOSv software is provided AS-IS without warranty of any kind. Under no circumstances may this software be used separate from the Cisco Modeling Labs Software that this software was provided with, or deployed or used as part of a production environment.

By using the software, you agree to abide by the terms and conditions of the Cisco End User License Agreement at http://www.cisco.com/go/eula. Unauthorized use or distribution of this software is expressly prohibited.
^C
banner login ^C
IOSv - Cisco Systems Confidential -

Supplemental End User License Restrictions

This IOSv software is provided AS-IS without warranty of any kind. Under no circumstances may this software be used separate from the Cisco Modeling Labs Software that this software was provided with, or deployed or used as part of a production environment.

By using the software, you agree to abide by the terms and conditions of the Cisco End User License Agreement at http://www.cisco.com/go/eula. Unauthorized use or distribution of this software is expressly prohibited.
^C
!
line con 0
line aux 0
line vty 0 4
!
!
end

 

 

 

////PC///

PC.pngping.png

10 Replies 10

rajen.jakhar
Level 1
Level 1

Configuration looks fine , Make sure interface Gi0/0 , obtaining IP address from DHCP from Internet Cloud . 

sh ip it brief 

sh ip nat trans

interface g0/0 if it has ip
Diegoncho_0-1664716859462.png

Diegoncho_1-1664716971852.png

 

 

only
ip route 0.0.0.0 0.0.0.0 interface g0/0 
is need to forward traffic via g0/0 (NAT outside)

the command does not work

Diegoncho_2-1664717293155.png

Diegoncho_3-1664717361301.png

 

 

this only notify not error 
now try ping from PC and check 

It doesn't work
Diegoncho_0-1664720245241.png

 

rajen.jakhar
Level 1
Level 1

dont see vlan 20 is created on switch , are you able to ping gateway of pc ? 

Can you Ping 192.168.20.1 

Also you can try to ping from  router interrace , 

ping 8.8.8.8 source 192.168.20.1

and check sh ip nat trans

ping from pc to gateway vlan 20
Diegoncho_0-1664737983858.png
ping from the router

Diegoncho_1-1664738124382.png

nat

Diegoncho_2-1664738199791.png

Could it be platform problem? i am using cisco modeling labs with this cloud as internet

Diegoncho_3-1664738313354.png

 

 

 

 

can you ping 8.8.8.8 from router ??
I think the connection between router and Internet is failed 

ping from the router
Diegoncho_0-1664738459123.png

Could it be platform problem? i am using cisco modeling labs with this cloud as internet

Diegoncho_1-1664738493448.png