cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1568
Views
0
Helpful
22
Replies

IOS NAT issue

peter.williams
Level 1
Level 1

I am trying to create a NAT statement to allow an Internet address to translate to an inside address with all ports open between them.  Can somebody help with some code examples or suggestions.

For example 208.7.xx.xx ---> 10.0.107.xx

Thank you

1 Accepted Solution

Accepted Solutions

Peter,


You are trying to PING 208.9.113.111 from 12.21.171.109 correct?
If this is so, then traffic will come to the router on its Fas0/0 interface.
Since there are no ACLs the traffic will be permitted.

If the PING fails, try this:
Do a traceroute to that IP and see if the path reaches your router.
i.e
From a windows machine you can do ''tracert 208.9.113.111'' and check the path and the last hops.

Also,
Can you PING 10.0.107.11 from the router itself?
Please check that the default gateway for 10.0.107.11 is 10.0.107.15

Federico.

View solution in original post

22 Replies 22

Laurent Aubert
Cisco Employee
Cisco Employee

Hi Peter,

Ples use the following command:

ip nat inside source static 10.0.107.xx 208.7.xx.xx

You will find a lot of examples here: http://www.cisco.com/en/US/partner/tech/tk648/tk361/tech_configuration_examples_list.html

HTH

Laurent.

Thank you for your post.  Will this allow all ports UDP and TCP?

Peter,

What you're looking at is just the static NAT statement. To allow outside access to a server.

When you're talking about permissions, that's handle by ACLs.

If the router has no ACLs, then by default all IP (TCP/UDP) traffic is permitted.

If the router has an ACL applied to its outside interface, then you need to make sure that the desired ports are allowed through.

Federico.

Thank you for the post.

As soon as I add "ip nat inside source static 10.0.107.11 208.7.xx.xx"  I lose outside connectivity to the outside interface.  10.0.107.11 is not the inside interface ip it is 10.0.107.15.

Also I have an access-list 1 permit 10.0.107.0 0.0.0.255 but it is not assigned to any interfaces, I believe it is for the the nat overload.

Please let me know how to put the NAT statement in so I do not lose connectivity.

Thank you

Peter,

If you lost connectivity to the outside interface when adding the static command is because 208.7.xx.xx is the same IP as the outside interface IP?

If you want to redirect traffic to an inside server based on ports, you can use the same static command with PAT. i.e.

Instead of:

"ip nat inside source static 10.0.107.11 208.7.xx.xx"

Use:

"ip nat inside source static tcp 10.0.107.11 80 208.7.xx.xx 80"   --> using port 80 (you can use this rule for any TCP/UDP port)

Another option is to create a static NAT like the first one:

"ip nat inside source static 10.0.107.11 208.7.xx.xx"

But where 208.7.xx.xx is a not-used IP (available)

To allow access from the outside, you need an ACL like this:

access-list 101 permit tcp any host 208.7.xx.xx eq 80

Or whatever ports you need...

Federico.

Federico,

I have added "ip nat inside source static 10.0.107.11 208.7.xx.xx (available).  I also added "access-list 101 permit ip host 208.7.xx.xx(available) host 10.0.107.11

However I am unable to ping the available outside ip address.  Is there something I still need to add?

Since my access 1 is what I am using for the overload should I change the access-list 101 to 1?

Thank you

Can you post the config so we can get a look at how you are configuring the router.

Thank you very much

Here is the config.

Thank you

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname test

!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
!
!
ip cef
!
!
ip domain name wai.com
!
!
!
crypto pki trustpoint TP-self-signed-2350298788
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-2350298788
revocation-check none
rsakeypair TP-self-signed-2350298788
!
!
crypto pki certificate chain TP-self-signed-2350298788
certificate self-signed 01
  30820245 308201AE A0030201 02020101 300D0609 2A864886 F70D0101 04050030
  31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
  69666963 6174652D 32333530 32393837 3838301E 170D3130 30353231 31393231
  30345A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
  4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D32 33353032
  39383738 3830819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
  8100BFA2 94494468 EBAFC19F C2A9DB96 E7197D94 6A5DF3A5 82C7A172 B430BAD3
  6012929C 04206572 63593CAB E0204F0F 7C0CDCC0 17E5DABB FADC7986 3056663D
  230B5EA9 25927634 C5B3ED1B ABFF945C D1BB1C33 D75E6E2E E3F0CD40 A13A346D
  4E157253 6DC8C67D 65C17635 04765F3F 93F3751A 72D61C43 3BBF2F61 4BE68D1D
  DD0D0203 010001A3 6D306B30 0F060355 1D130101 FF040530 030101FF 30180603
  551D1104 11300F82 0D6D6F76 69312E77 61692E63 6F6D301F 0603551D 23041830
  1680146C 18C110EE 5EA1DC0C D4CC53C2 9C30AE89 47350530 1D060355 1D0E0416
  04146C18 C110EE5E A1DC0CD4 CC53C29C 30AE8947 3505300D 06092A86 4886F70D
  01010405 00038181 00337DDE 5BD12C0A 45500309 12468CB4 7E1E4AC3 7ED256D3
  4003AB3C ED66C699 032589A4 AA84ED58 C7436732 379A425E 531AE143 AA7F22CA
  FBD36B23 13FE77B7 5D628CB4 33734558 8A1783ED E801C49E 9CC5FF9B 460F203B
  90F22D4E C1D34319 7FDB8229 0EE5F826 40ACAEB7 08E29A66 FDC270D3 EF97B2F9
  C324AF62 64AE65C8 5D
  quit
!
!
!
!
!
interface FastEthernet0/0
ip address 208.7.xx.xx 255.255.255.xxx
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.0.107.15 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
router ospf 10
log-adjacency-changes
network 10.0.107.0 0.0.0.255 area 0
!
ip classless
ip route 0.0.0.0 0.0.0.0 208.7.xx.xx
!
ip http server
ip http secure-server
ip nat inside source list 1 interface FastEthernet0/0 overload
ip nat inside source static 10.0.107.11 208.7.xxx.xxx
!
access-list 1 remark CCP_ACL Category=2
access-list 1 permit 10.0.107.0 0.0.0.255
!
!
control-plane
!
!
!
line con 0
line aux 0
line vty 0 4
!
scheduler allocate 20000 1000
!
end

Just to clarify something, the outside ip address you want to use is different from the one configured FastEthernet0/0 right ? I'm confused with all those xxx ;-)

Also from where do you try to ping the outside IP address ?

Thanks

Laurent.

Sorry for the confusion - this is what I need -

int fa0/0 - ip address 208.7.567.123

int fa0/1 - ip address 10.0.107.15

I need a ip address 208.7.567.124 (free ip address) to translate to 10.0.107.11.  I need all the ports open (TCP and UDP)

I am pinging the ip address from the internet

Thank you for your help

Peter,

Correct me if I'm wrong:

You need to access the IP 10.0.107.11 from the Internet but using the IP 208.7.567.123  --> nice IP (you cannot have an octet above 255) ;p

To do this:

ip nat inside source static 10.0.107.11 208.7.567.123

If the above .208 is a free IP address, I don't see why adding the above rule blocks the communication with your fas0/1 interface.

If you have an ACL applied, you add the following:

access-list ACL_NAME permit ip any host 208.7.567.123

Please let me know if this is not what you need.

Federico.

I was just making up a number.

I put in the following -

ip nat inside source static 10.0.107.11 208.9.113.111 (sorry making up another number)

access-list 1 permit 208.9.113.111 (sorry making up another number)

I am still not able to ping 208.9.113.111, but I am able to ping the interface ip which is (208.9.113.110)

I really don't understand why this does not work.

Thank you for your help

Don't configure "access-list 1 permit 208.9.113.111".

After  creating the static nat translation, you would need to "clear ip  nat  trans *" on the router, just to make sure that the previously PAT inside  host is cleared from the nat table.

Then, you would  need to make sure that proxy arp is enabled on fa0/0.

Lastly,  perform a "clear arp" on the next hop router/ISP router, OR reload the  ISP router if you don't have access to it. This is to make sure that the  correct ARP entry is created on the ISP router for the NATed ip address  of 208.9.113.111. On the ISP router, 208.9.113.111 should have an ARP  entry with the MAC address of your router fa0/0 interface.

Hope  that helps.

How do I make sure that the proxy arp is enables on fa0/0?

Thank you for your help

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco