Community discussions

MikroTik App
 
markrudling
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Tue Aug 15, 2006 6:28 pm

Nat is driving me crazy

Sat Feb 16, 2008 10:34 pm

Hello everyone.

Please can you help me, this is going to kill me.

I need to have 2 services running via one external IP, each service using different ports, on different devices. Some udp, some tcp. How would this be done?

Pls, i know this might seem simple, but i have to get this working. Everything i have tried does not work.

Maby an expample that i can change the ips to suit my needs.

Thanks a mill
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Nat is driving me crazy

Sun Feb 17, 2008 1:01 am

firewall - nat - add - dstnat - dst-address=your_external_address, dst-port=your_port, action = dst-nat, to-addresses = your_internal_ip, to-ports = your_internal_port
 
idelac3
just joined
Posts: 19
Joined: Mon Sep 25, 2006 12:16 pm

Re: Nat is driving me crazy

Sun Feb 17, 2008 10:08 am

Also make sure Connection Tracking is enabled. NAT won't work without it.
 
User avatar
machack
Frequent Visitor
Frequent Visitor
Posts: 65
Joined: Fri Jun 01, 2007 9:35 pm
Location: San Luis Argentina
Contact:

Re: Nat is driving me crazy

Fri Feb 22, 2008 5:52 pm

I have the same problem.

my firewall config:
Flags: X - disabled, I - invalid, D - dynamic 
 0   chain=srcnat action=masquerade src-address=10.50.0.0/24 

 1   chain=dstnat action=dst-nat to-addresses=10.50.0.2 to-ports=4899 
     in-interface=ether1 dst-port=7001 protocol=tcp
my ip config
 #   ADDRESS            NETWORK         BROADCAST       INTERFACE              
 0   40.0.10.251/24     40.0.10.0       40.0.10.255     ether1                 
 1   10.50.0.1/24       10.50.0.0       10.50.0.255     ether4
connection tracking
enabled: yes
      tcp-syn-sent-timeout: 5s
  tcp-syn-received-timeout: 5s
   tcp-established-timeout: 1d
      tcp-fin-wait-timeout: 10s
    tcp-close-wait-timeout: 10s
      tcp-last-ack-timeout: 10s
     tcp-time-wait-timeout: 10s
         tcp-close-timeout: 10s
               udp-timeout: 10s
        udp-stream-timeout: 3m
              icmp-timeout: 10s
           generic-timeout: 10m
             tcp-syncookie: no
               max-entries: 524288
             total-entries: 4

Please help!!!
 
kthameen
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Wed Dec 21, 2005 4:22 am
Location: Leuven,Belgium

Re: Nat is driving me crazy

Fri Feb 22, 2008 6:52 pm

I have the same problem.

my firewall config:
Flags: X - disabled, I - invalid, D - dynamic 
 0   chain=srcnat action=masquerade src-address=10.50.0.0/24 

 1   chain=dstnat action=dst-nat to-addresses=10.50.0.2 to-ports=4899 
     in-interface=ether1 dst-port=7001 protocol=tcp
my ip config
 #   ADDRESS            NETWORK         BROADCAST       INTERFACE              
 0   40.0.10.251/24     40.0.10.0       40.0.10.255     ether1                 
 1   10.50.0.1/24       10.50.0.0       10.50.0.255     ether4
connection tracking
enabled: yes
      tcp-syn-sent-timeout: 5s
  tcp-syn-received-timeout: 5s
   tcp-established-timeout: 1d
      tcp-fin-wait-timeout: 10s
    tcp-close-wait-timeout: 10s
      tcp-last-ack-timeout: 10s
     tcp-time-wait-timeout: 10s
         tcp-close-timeout: 10s
               udp-timeout: 10s
        udp-stream-timeout: 3m
              icmp-timeout: 10s
           generic-timeout: 10m
             tcp-syncookie: no
               max-entries: 524288
             total-entries: 4

Please help!!!

This should help you

chain=dstnat dst-address=40.0.10.251 action=dst-nat to-addresses=10.50.0.2 to-ports=4899 dst-port=7001 protocol=tcp
 
fosben
Frequent Visitor
Frequent Visitor
Posts: 81
Joined: Thu Dec 14, 2006 4:50 pm

Re: Nat is driving me crazy

Fri Feb 22, 2008 7:04 pm

also got a problem with dst nat. Its set up like Chupaka posted and connection tracking is on.

When I connect to my external ip from another computer its able to display some of the page, but very very slowly and the pictures fails. Also I noticed that IE displayed my internal ip at the status bar when it loads the page..

Im using a rb112, ros v3.3. This setting worked fine earlier (v 2-9), but as I didnt need the dst nat for some time it was disabled until now..