Community discussions

MikroTik App
 
Trisc
Member Candidate
Member Candidate
Topic Author
Posts: 242
Joined: Sat May 29, 2004 11:24 pm
Location: Glos, UK

NAT problem

Thu Mar 25, 2010 12:52 pm

Hi

I have the following rules in my firewall to allow Outlook Web Access to an Exchange Server inside the network:

1 ;;; HTTPS
chain=dstnat action=dst-nat to-addresses=192.168.1.10 to-ports=443
protocol=tcp src-address=!10.5.50.0/24 dst-port=443

2 ;;; RWW
chain=dstnat action=dst-nat to-addresses=192.168.1.10 to-ports=4125
protocol=tcp dst-port=4125

The trouble is that other computers on 192.168.0/24 network cannot connect to secure websites using HTTPS.

Can anyone suggest a fix?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: NAT problem

Thu Mar 25, 2010 1:19 pm

The quick fix is an entry in "/ip dns static" for the secure site, using the 192.168.1.10 address. Locanet users will use this dns, and wan users will use the normal dns server resolution.
 
Trisc
Member Candidate
Member Candidate
Topic Author
Posts: 242
Joined: Sat May 29, 2004 11:24 pm
Location: Glos, UK

Re: NAT problem

Thu Mar 25, 2010 2:29 pm

Not sure how this would work! The client is also using a Small Biz server which handles local DNS requests.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: NAT problem

Thu Mar 25, 2010 2:37 pm

OK. Then the not-so-quick. You will need to remove the "src-address" setting in the HTTPS dstnat and add a local masquerade.

/ip firewall nat
add chain=srcnat action=masquerade src-address=192.168.1.0/24

Works for me. This is called a "hairpin nat" on the forum if you want to search for other posts.
 
Trisc
Member Candidate
Member Candidate
Topic Author
Posts: 242
Joined: Sat May 29, 2004 11:24 pm
Location: Glos, UK

Re: NAT problem

Thu Mar 25, 2010 3:49 pm

If I delete HTTPS rule how will port 443 forward to the correct internal destination?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: NAT problem

Thu Mar 25, 2010 4:01 pm

1 ;;; HTTPS
chain=dstnat action=dst-nat to-addresses=192.168.1.10 to-ports=443
protocol=tcp src-address=!10.5.50.0/24 dst-port=443
I use something like this:

1 ;;; HTTPS
chain=dstnat action=dst-nat to-addresses=192.168.1.10 to-ports=443
protocol=tcp dst-port=443

Is there a reason you exclude the 10.5.50.0/24 net?
 
Trisc
Member Candidate
Member Candidate
Topic Author
Posts: 242
Joined: Sat May 29, 2004 11:24 pm
Location: Glos, UK

Re: NAT problem

Thu Mar 25, 2010 4:24 pm

I've changed the original port forwarding rule to:

1
chain=dstnat action=dst-nat to-addresses=192.168.1.99 to-ports=21
protocol=tcp dst-address=!192.168.1.3 dst-address-type=local
dst-port=21

192.168.1.3 being the router address. It seems to work on my testing setup.

The reason for excluding 10.5.50.0/24 is that there is a hotspot network on another interface and port 443 wasn't working there either.

With the new rule it seems to work.

I already have a masquerade rule on the router.

Who is online

Users browsing this forum: Amazon [Bot], dvdlss, jh1, lurker888, nonolk and 59 guests