Community discussions

MikroTik App
 
dptoinformatica
just joined
Topic Author
Posts: 2
Joined: Thu May 19, 2022 6:35 pm

Problems to change IP source to other IP dest using NAT

Thu May 19, 2022 6:42 pm

I've got a RouterBOARd 951G 2HnD. I've configure to connect the Eth1 with an static IP 192.168.X.X, to the Eth5 i will connect a PC with 192.168.1.30 IP and i need to transform this to 192.168.79.121. I've tried using NAT by this way (image file). What i'm doing wrong. Thanks in advance!
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Problems to change IP source to other IP dest using NAT

Thu May 19, 2022 7:07 pm

dst-address no es lo nuevo IP, es la dirección de destino de la conexión

dst-address is not the new IP, it is the destination address of the connection
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1054
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: Problems to change IP source to other IP dest using NAT

Thu May 19, 2022 9:39 pm

Hi @dptoinformatica, welcome to the forum!

You have to use the "action"-tab and set action drop-box to "src-nat" and "To Adrresses:" to "192.168.79.121". Check the log box if you want to enable tracing. You may also use the command "/ip firewall nat add chain=srcnat src-address=192.168.1.30 out-interface=ether5 action=src-nat to-addresses=192.168.79.121"
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Problems to change IP source to other IP dest using NAT

Fri May 20, 2022 5:10 am

Source nat (not destination nat) is the path.
think about it, the general rule to masquerade all traffic out of ones router is typically chain=srcnat action=masquerade so that all private IPs appear to come from the identified outgoing inteface usually the WAN interface.
 
dptoinformatica
just joined
Topic Author
Posts: 2
Joined: Thu May 19, 2022 6:35 pm

Re: Problems to change IP source to other IP dest using NAT

Fri May 20, 2022 11:19 am

I've got a RouterBOARd 951G 2HnD. I've configure to connect the Eth1 with an static IP 192.168.X.X, to the Eth5 i will connect a PC with 192.168.1.30 IP and i need to transform this to 192.168.79.121. I've tried using NAT by this way (image file). What i'm doing wrong. Thanks in advance!
Thats the situation I need to enable connectivity between the two pc's, I've added routes to make it possible and:
-I can ping from PC2 to PC1
-I can't ping from PC1 to PC2
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Problems to change IP source to other IP dest using NAT

Fri May 20, 2022 1:17 pm

The schema is near useless, but only if:
1) Really one single lan cable connect PC1 with Router, and a single cable Router and PC2?
Why do not link directly the 2 PC?

2) Why not simply change the IP of PC?
3) Why not simply add another IP to PC?

You can not NAT anything if the Router if is not the default Gateway or if the two PC have another LAN connection with it's own gateway.

export the config with
/export file=config
and after removed the private data, paste on forum.

Also paste both IPv4 configuration of the two PC.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Problems to change IP source to other IP dest using NAT

Fri May 20, 2022 6:14 pm

If the two PCs are behind the same router and simply on different subnets, to connect them is a matter of forward chain firewall rules???

Who is online

Users browsing this forum: No registered users and 36 guests