cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1136
Views
4
Helpful
7
Replies

NAT without DMZ

marekduba
Level 1
Level 1

Hi,

here is a sample config:

interface FastEthernet0

ip address 1.1.1.2 255.255.255.252

ip nat outside

ip virtual-reassembly

duplex auto

speed auto

no cdp enable

!

interface Vlan1

ip address 10.0.1.2 255.255.255.0

ip nat inside

ip virtual-reassembly

!

ip classless

ip route 0.0.0.0 0.0.0.0 1.1.1.1

!

!

ip nat inside source list 120 interface FastEthernet0 overload

ip nat inside source static tcp 10.0.1.33 80 interface FastEthernet0 80

!

!

access-list 120 permit ip 10.0.1.0 0.0.0.255 any

!

end

and now, what is my problem:

a PC in the internal network would like to communicate with 1.1.1.2:80 (a 1.1.1.2 is the response from DNS server).

It is solvable by ip nat outside command? Are anybody have any idea? I don't want to configure DMZ.

THX for ideas...

1 Accepted Solution

Accepted Solutions

Solution 3:

------------------

access-list 55 permit host 1.1.1.2

route-map HTTPredirect permit 10

match ip address 55

set ip next-hop 10.0.1.33

int vlan1

ip policy route-map HTTPredirect in

------------------

This would point the traffic towards the HTTP server's MAC address, but you still need to configure it to listen on 1.1.1.2's IP address (which may or may not be possible on the servers OS)

As for solution 2: DNS is out of my expertise, so we'd need someone else to help out with that.

View solution in original post

7 Replies 7

gpulos
Level 8
Level 8

your DNS is configured incorrectly if you ping a DNS name and it responds with 1.1.1.2. (unless this is what you want to happen)

1.1.1.2 is the routers ethernet interface and will not respond to http (80) requests. (do you have http server configured where you can access the router via http at the 1.1.1.2:80 address/port?)

since this ethernet interface is 1.1.1.2/30 then the only other host that can reside on that subnet is 1.1.1.1/30.

your question may not be clear as i'm not sure where you are worried about a DMZ..???

what is the "internal network" where the PC resides? if it is on the 10.0.1.0/24 network, then NO nat will not be needed.

The PC is a notebook.

When the notebook is in the another network (another internet access), all works fine. The user clicks on a desktop shortcut, and open a website at 1.1.1.2:80 (address is translated to internal web server 10.0.1.33:80).

but

if the notebook is in a local network (10.0.1.0/24) and user clicks on the same shortcut (same dns name, same ip address 1.1.1.2:80), the user can't establishe a connection, because the router could not translate an address - because the connection come from NAT inside interface!!!

Exists any solution?

Maybe help some DNS translating on the router... like an ip nat outside...

pls advise me some solution

The problem here is in the design. The static NAT entry you configured will only translate traffic coming in the outside interface. There isn't any feature (that I know of) that will let you hair-pin the connection from the internal network, through the router, and translated back into the internal network.

Some workarounds I can think of:

1. Make a different hyperlink for internal users to click

2. Get creative with DNS (resolve the IP differently for internal users than external users)

3. Somehow configure the HTTP server to use 1.1.1.2 as an alias. Cisco routers have this feature, where they can respond to requests destined for another IP. (You'd need to pair this with PBR on the router, so packets get forwarded back out the FA interface to servers MAC address...might be more trouble than its worth)

THX a lot...

do you have any examples for solution 3?

and what about solution 2? I saw some tutorials, where router modifies the DNS reply for internal ip address... but not for routers (only PIX) :o((

Solution 3:

------------------

access-list 55 permit host 1.1.1.2

route-map HTTPredirect permit 10

match ip address 55

set ip next-hop 10.0.1.33

int vlan1

ip policy route-map HTTPredirect in

------------------

This would point the traffic towards the HTTP server's MAC address, but you still need to configure it to listen on 1.1.1.2's IP address (which may or may not be possible on the servers OS)

As for solution 2: DNS is out of my expertise, so we'd need someone else to help out with that.

Ok, thx a lot. The solution with DNS is seems to be a best.

bye

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