Sei sulla pagina 1di 17

NAT TRANSLATION

Inbound packet to router 0

Outbound packet from router 0

Inbound packet to router 1

Outbound packet from router 1

ROUTER 1 DETAILS:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int s2/0
Router(config-if)#ip address 200.10.0.2 255.255.255.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial2/0, changed state to up

Router(config-if)#exit
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up

Router(config)#int fa0/0
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#no shut

%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)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 s2/0
Router(config)#show ip route
^
% Invalid input detected at '^' marker.

Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2


E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

10.0.0.0/8 is directly connected, FastEthernet0/0

200.10.0.0/24 is directly connected, Serial2/0

S* 0.0.0.0/0 is directly connected, Serial2/0


Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip nat inside source static 10.0.0.254 200.10.0.2
Router(config)#int fa0/0
Router(config-if)#ip nat inside
Router(config-if)#int s2/0
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#show run
Building configuration...

Current configuration : 783 bytes


!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!

interface FastEthernet0/0
ip address 10.0.0.1 255.0.0.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
shutdown
!
interface Serial2/0
ip address 200.10.0.2 255.255.255.0
ip nat outside
clock rate 2000000
!
interface Serial3/0
no ip address
clock rate 2000000
shutdown
!
interface FastEthernet4/0
no ip address
shutdown
!

interface FastEthernet5/0
no ip address
shutdown
!
ip nat inside source static 10.0.0.254 200.10.0.2
ip classless
ip route 0.0.0.0 0.0.0.0 Serial2/0
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
Router#

ROUTER 0 DETAILS:

Router>en

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut

%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)#exit
Router(config)#int s2/0
Router(config-if)#ip address 200.10.0.1 255.255.255.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial2/0, changed state to down


Router(config-if)#exit
Router(config)#
%LINK-5-CHANGED: Interface Serial2/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up

Router(config)#ip route 0.0.0.0 0.0.0.0 s2/0


Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

192.168.1.0/24 is directly connected, FastEthernet0/0

200.10.0.0/24 is directly connected, Serial2/0

S* 0.0.0.0/0 is directly connected, Serial2/0


Router#

Router con0 is now available

Press RETURN to get started.

Router>en
Router#comf t
^
% Invalid input detected at '^' marker.

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#access-list 1 permit 192.168.1.0 0.0.0.255


Router(config)#ip nat inside source list 1 interface s2/0 overload
Router(config)#int s2/0
Router(config-if)#ip nat outside
Router(config-if)#int fa0/0
Router(config-if)#ip nat inside
Router(config-if)#
Router(config-if)#exit
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#copy run start


Destination filename [startup-config]?
Building configuration...
[OK]
Router#show run
Building configuration...

Current configuration : 819 bytes


!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!

hostname Router
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0

no ip address
duplex auto
speed auto
shutdown
!
interface Serial2/0
ip address 200.10.0.1 255.255.255.0
ip nat outside
!
interface Serial3/0
no ip address
clock rate 2000000
shutdown
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
no ip address
shutdown
!
ip nat inside source list 1 interface Serial2/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 Serial2/0
!

!
access-list 1 permit 192.168.1.0 0.0.0.255
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end

Router#

Potrebbero piacerti anche