Community discussions

MikroTik App
 
redarrow
just joined
Topic Author
Posts: 4
Joined: Sun Aug 02, 2009 3:50 pm
Location: Port Elizabeth, South Africa

Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 1:28 pm

Hi,

I have two systems, both on the same private subnet.
Both are connected to a WAN (actually a wifi user group). As the one machine is a server, I've got it 1:1 natted so that external users can fully access it. The rules I've used for this is:
 0   chain=srcnat action=src-nat to-addresses=172.21.3.90 src-address=192.168.0.170 
 1   chain=dstnat action=dst-nat to-addresses=192.168.0.170 dst-address=172.21.3.90 
This works fine, users on the external network can access the system just fine.

My personal system makes use of src-nat to go via the external IP of my wifi interface:
10  chain=srcnat action=src-nat to-addresses=172.21.254.17 dst-address=172.16.0.0/12 
This also works as expected, the problem however is that I cannot access my server via it's external IP - at least not fully - I can ping it, but cannot access any services on it, such as the http server.
Obviously I don't really need to, as I can access it via the local IP, but for testing purposes it would be nice to be able to access the external IP.

I imagine I need to use mangle rules or something to accomplish this, but I don't really know where to start.

Any ideas?
Thanks. :)
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 1:33 pm

Last time I checked with mrz, you would need a masquerade rule for local-to-local. I will use the 192.168.0.0/24 net for this example:

/ip firewall nat
add chain=srcnat action=masquerade src-address=192.168.0.0/24
 
redarrow
just joined
Topic Author
Posts: 4
Joined: Sun Aug 02, 2009 3:50 pm
Location: Port Elizabeth, South Africa

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 1:57 pm

Last time I checked with mrz, you would need a masquerade rule for local-to-local. I will use the 192.168.0.0/24 net for this example:

/ip firewall nat
add chain=srcnat action=masquerade src-address=192.168.0.0/24
You appear to be correct! :D
I replaced my src-nat rule with yours and now it's working fine!

Thanks very much! :)
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 2:15 pm

You are welcome! :D

Myth: You can't "double back" to a localnet address by using the public address.
Result: BUSTED!!
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 3:49 pm

actually, myth is: You can't "double back" to a localnet address by using the public address and not hiding your address by router's one.

you busted wrong myth =)
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Wed Sep 09, 2009 9:24 pm

actually, myth is: You can't "double back" to a localnet address by using the public address and not hiding your address by router's one.

you busted wrong myth =)
I don't remember that as part of the ground rules. I (edit: mrz actually) busted right myth!
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Trouble accessing dst-nat'ted IP's from src-nat'ted system.

Thu Sep 10, 2009 5:02 pm

then use search: it was busted long time ago =)

Who is online

Users browsing this forum: Bing [Bot], Fi011, Mikuser17, quantum666, shahzaddj1 and 188 guests