search the web

Monday, November 16, 2015

Configuring NAT

Configuring NAT

1.Identify the network to be translated
2.Add a default static route pointing to your ISP router
3.Label the interfaces ( And the label has an affect on the interfaces )
4.Apply ip nat command

R3
show ip route
conf t
access-list 1 permit 192.168.0.0 0.0.255.255
!through this we have allowed any network starting from 192.168. to be translated to the internet

ip route 0.0.0.0 0.0.0.0 192.168.1.1

ip name-server 4.2.2.2
!This command assigns a dns server addressexit
ping 192.168.1.1
conf t

ping google.com

ip domain-lookup
!enables dns lookup


interface e0
ip nat outside
exit
interface s0
ip nat inside
exit
!we have labled the interfaces and it will affect them as well.

ip nat inside source list 1 interface e0 overload
!please nat the addresses mentioned in the source list 1 and overload them on outside interface e0.

R1
conf t
access-list 1 permit 192.168.0.0 0.0.255.255
ip route 0.0.0.0 0.0.0.0 192.168.100.2
int s1/0
ip nat outside
exit
int e0/0
ip nat inside
exit
ip nat inside source list 1 interface s1/0 overload
i want to nat the addresses mentioned in source list 1 and please overload them on outside interface which is s1/0
exit


STATIC NAT ON R3
we want to map 192.168.1.12 to our R2's ip address 192.168.100.1. Any traffic coming to 192.168.1.12 will be sent to 192.168.100.1
first we label the R3's interface s1 which is connected to R2

conf t
int s1
ip nat inside
exit

ip nat inside source static 192.168.200.1 192.168.1.12
Please statically map the inside local address 192.168.200.1 to the inside global address 192.168.1.12.


PORT MAPPING
ip nat inside source static tcp 192.168.200.1 23 192.168.1.11 23
This command statically maps the port 23 of 192.168.1.11 to the port 23 of R2 192.168.200.1

DYNAMIC NAT
R3
show ip route
conf t
access-list 1 permit 192.168.0.0 0.0.255.255
!through this we have allowed any network starting from 192.168. to be translated to the internet

ip route 0.0.0.0 0.0.0.0 192.168.1.1

ip name-server 4.2.2.2
!This command assigns a dns server addressexit
ping 192.168.1.1
conf t

ping google.com

ip domain-lookup
!enables dns lookup


interface e0
ip nat outside
exit
interface s0
ip nat inside
exit
!we have labled the interfaces and it will affect them as well.
ip nat pool PUBADD 192.168.1.11 192.168.1.15 netmask 255.255.255.0
!We have created a pool of public address by name of PUBADD.

ip nat inside source list 1 pool PUBADD overload

!please nat the addresses mentioned in the source list 1 and overload them on outside pool of address which PUBADD.


Thanks for visiting if there is any doubt or question about NAT (Network Adress Translation) please write down in comments

for initial configuration of Router, switch or AP visit link below

initial configuration of Router, Switch or AP

No comments: