How to configure a Cisco Router for NATing a web server having Private IP Address.
|
Sunday, September 6, 2009
Sample NAT configuration for cisco router
Sample Configuration to Allow Internal Users to Access the Internet
interface ethernet 0
ip address 10.10.10.1 255.255.255.0
ip nat inside
interface ethernet 1
ip address 10.10.20.1 255.255.255.0
ip nat inside
! two lan networks are connected to internet
interface serial 0
ip address 172.16.10.64 255.255.255.0
ip nat outside
ip nat pool mypool 172.16.10.1 172.16.10.63 prefix 24
! just type the first ip, last ip, mask of these ip
ip nat inside source list 7 pool mypool
!
!
!--- Indicates that any packets received on the inside interface that
!--- are permitted by access-list 7
!--- will have the source address translated to an address out of the
!--- NAT pool "mypool".
access-list 7 permit 10.10.10.0 0.0.0.31
access-list 7 permit 10.10.20.0 0.0.0.31
!--- Access-list 7 permits packets with source addresses ranging from
!--- 10.10.10.0 through 10.10.10.31 and 10.10.20.0 through 10.10.20.31.
Further details available at http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094e77.shtml
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Configuring NAT to Allow Internal Users to Access the Internet Using Overloading
interface ethernet 0
ip address 10.10.10.1 255.255.255.0
ip nat inside
interface ethernet 1
ip address 10.10.20.1 255.255.255.0
ip nat inside
interface serial 0
ip address 172.16.10.64 255.255.255.0
ip nat outside
ip nat pool mypool 172.16.10.1 172.16.10.1 prefix 24
!
!--- Defines a NAT pool named mypool with a range of a single IP
!--- address, 172.16.10.1.
ip nat inside source list 7 pool mypool overload
!
!
!
!
!--- Indicates that any packets received on the inside interface that
!--- are permitted by access-list 7 will have the source address
!--- translated to an address out of the NAT pool named mypool.
!--- Translations will be overloaded which will allow multiple inside
!--- devices to be translated to the same valid IP address.
access-list 7 permit 10.10.10.0 0.0.0.31
access-list 7 permit 10.10.20.0 0.0.0.31
!--- Access-list 7 permits packets with source addresses ranging from
!--- 10.10.10.0 through 10.10.10.31 and 10.10.20.0 through 10.10.20.31.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Configuring NAT to Redirect TCP Traffic to Another TCP Port or Address:
interface ethernet 0
ip address 172.16.10.1 255.255.255.0
ip nat inside
interface serial 0
ip address 200.200.200.5 255.255.255.252
ip nat outside
ip nat inside source static tcp 172.16.10.8 8080 172.16.10.8 80
!--- Static NAT command that states any packet received in the inside
!--- interface with a source IP address of 172.16.10.8:8080 will be
!--- translated to 172.16.10.8:80.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
How to configure a webserver having private ip address to be reached by public?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment