Community discussions

MikroTik App
 
benoitc
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Wed Jul 08, 2020 12:33 am

how to route public IP to another machine without NAT

Mon Jun 27, 2022 1:07 pm

My ISP provided me a /28 that I announce using BGP on a CCR2004. I would like to have one machine behind it using one of the IPS in this /29 as its public address but don't want to have NAT on the core router (CCR2004). The machine below will act as the router for a LAN and do NAT itself.

I am not sure how to this exactly. Since having a /31 is not possible on routeros what should I do?
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: how to route public IP to another machine without NAT

Mon Jun 27, 2022 1:25 pm

Mikrotiks and various other devices support /32, you can use any local address on the Mikrotik for the CCR end and one of your spare public addresses for the machine end. If the public addresses are attached to a layer 2 network you will have to enable proxy ARP.
 
benoitc
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Wed Jul 08, 2020 12:33 am

Re: how to route public IP to another machine without NAT

Mon Jun 27, 2022 3:57 pm

Mikrotiks and various other devices support /32, you can use any local address on the Mikrotik for the CCR end and one of your spare public addresses for the machine end. If the public addresses are attached to a layer 2 network you will have to enable proxy ARP.
so if assign to sfp12 10.101.1.1/32 i can use on the other machine XX.XX.XX.XX as public ip on the other machine? What about the routes? Can you share a rough example?
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

Re: how to route public IP to another machine without NAT  [SOLVED]

Mon Jun 27, 2022 4:37 pm

So on your CCR
/ip address
add address=10.101.1.1/32 interface=sfp12 network=RR.SS.TT.UU

which will automatically add the /32 route

And if the other device were a Mikrotik
/ip address
add address=RR.SS.TT.UU/32 interface=ether1 network=10.101.1.1
/ip route
add comment="default gateway" distance=1 gateway=10.101.1.1


Many years ago you had to use tricks on linux, I don't believe that is any longer the case.
 
benoitc
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Wed Jul 08, 2020 12:33 am

Re: how to route public IP to another machine without NAT

Mon Jun 27, 2022 10:17 pm

So on your CCR
/ip address
add address=10.101.1.1/32 interface=sfp12 network=RR.SS.TT.UU

which will automatically add the /32 route

And if the other device were a Mikrotik
/ip address
add address=RR.SS.TT.UU/32 interface=ether1 network=10.101.1.1
/ip route
add comment="default gateway" distance=1 gateway=10.101.1.1


Many years ago you had to use tricks on linux, I don't believe that is any longer the case.
thanks it worked perfectly!

Who is online

Users browsing this forum: cdblue and 53 guests