Community discussions

MikroTik App
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Use of public IP space on local hosts. 1:1 NAT?

Mon Mar 02, 2020 11:04 pm

Hi,

I have a customer who wants a /29 public subnet to be assigned directly to hosts statically.

e.g they have a server and want it publicly visible as 103.107.xxx.xxx by assigning 103.107.xxx.xxx directly to the servers NIC.

Normally customers have a single Static IP /30 which gets assigned to the wan of their router and local networks are natted through that address.

This time he wants to use the usable addresses from the /29 on individual hosts using the builtin firewall of the server's OS as the only protection between the host and outside world

Is this 1:1 nat or something else?

How can I enable this in Mikrotik?

Thanks,
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Use of public IP space on local hosts. 1:1 NAT?

Tue Mar 03, 2020 12:43 am

It's routed subnet. If your current config is:
/ip address
add interface=<to customer> address=a.a.a.x/30
and customers has a.a.a.y on their router, you'll do:
/ip route
add dst-address=b.b.b.b/29 gateway=a.a.a.y
and whole /29 will be routed to customer.
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Tue Mar 03, 2020 1:47 am

It's routed subnet. If your current config is:
/ip address
add interface=<to customer> address=a.a.a.x/30
and customers has a.a.a.y on their router, you'll do:
/ip route
add dst-address=b.b.b.b/29 gateway=a.a.a.y
and whole /29 will be routed to customer.
Ok, so...

ISP Router (CCR):
/ip address add interface=customer-facing address=10.200.0.1/24
Customer router:
WAN: 10.200.0.20/24
Gateway: 10.200.0.1
/ip route add dst-address=103.107.xxx.xxx/29 gateway=10.200.0.1
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Use of public IP space on local hosts. 1:1 NAT?

Tue Mar 03, 2020 2:09 am

Yes. And then customer can do anything with whole /29. Use the traditional way, assign one address to internal interface with /29 mask and have five addresses for other devices. Or there are various ways how to use all eight addresses. It's up to them.
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Tue Mar 03, 2020 4:06 am

Yes. And then customer can do anything with whole /29. Use the traditional way, assign one address to internal interface with /29 mask and have five addresses for other devices. Or there are various ways how to use all eight addresses. It's up to them.
Ok, So I have tested that but its not working. Do I need any NAT rules? Currently I have nothing in /ip firewall nat
 
User avatar
evince
Member
Member
Posts: 355
Joined: Thu Jul 05, 2012 12:11 pm
Location: Harzé - Belgique
Contact:

Re: Use of public IP space on local hosts. 1:1 NAT?

Tue Mar 03, 2020 10:35 am

No, you do not need NAT rule as you have a public subnet.

Depending to how is configured your connection, you can assign your wan ip directly on your devices.

First, you need to assign an ip address to your "bridge" if you have 1, and the use this address as gateway on your devices.
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 3:35 am

No, you do not need NAT rule as you have a public subnet.

Depending to how is configured your connection, you can assign your wan ip directly on your devices.

First, you need to assign an ip address to your "bridge" if you have 1, and the use this address as gateway on your devices.
Still not working...

CPE:
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge ssid=MikroTik wireless-protocol=802.11
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=LAN
/ip address
add address=10.255.0.2/30 interface=ether1 network=10.255.0.0
add address=103.107.224.161/29 interface=ether2 network=103.107.224.160
/ip dns
set servers=8.8.8.8
/ip firewall nat
add action=masquerade chain=srcnat disabled=yes out-interface-list=WAN
/ip route
add distance=1 gateway=10.255.0.1
add distance=1 dst-address=103.107.224.160/29 gateway=10.255.0.1
ISP CCR1036:
/ip address add address=10.255.0.1/30 comment=TESTING interface=Local_Trunk network=10.255.0.0
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 4:06 am

Route must be on ISP's router:
/ip route
add distance=1 dst-address=103.107.224.160/29 gateway=10.255.0.2
Not on customer's.
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 5:08 am

Route must be on ISP's router:
/ip route
add distance=1 dst-address=103.107.224.160/29 gateway=10.255.0.2
Not on customer's.
Works a treat!

Thanks a lot for your help :)
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 5:18 am

Route must be on ISP's router:
/ip route
add distance=1 dst-address=103.107.224.160/29 gateway=10.255.0.2
Not on customer's.
How would I go about static routing a public subnet to a PPPOE client with a dynamic remote address?

Thanks,
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 2:49 pm

It should be "Routes" option in PPP->Secrets.
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 4:23 pm

It should be "Routes" option in PPP->Secrets.
Your a legend!

Would you recommend providing customer static routes / public IPs via PPPOE? I have heard alot of people advise against it but never given a reason why.

Thanks,
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Use of public IP space on local hosts. 1:1 NAT?

Fri Mar 13, 2020 4:41 pm

I don't have clear answer. PPPoE is used for internet access, it works, other addresses can be routed over it, ... so from this perspective I see no problem. But I'm not ISP, maybe they could have some problem I'm not seeing. For example, I don't know how's compatibility with common client routers, many have very limited interface and I can imagine that some may not support routed subnets over PPPoE. I'm a customer and big RouterOS fan, so I don't need to care about these things, RouterOS can do it and that's all I need. :)
 
saibarker
newbie
Topic Author
Posts: 45
Joined: Tue Jun 06, 2017 11:50 am

Re: Use of public IP space on local hosts. 1:1 NAT?

Sun Mar 15, 2020 1:43 am

I don't have clear answer. PPPoE is used for internet access, it works, other addresses can be routed over it, ... so from this perspective I see no problem. But I'm not ISP, maybe they could have some problem I'm not seeing. For example, I don't know how's compatibility with common client routers, many have very limited interface and I can imagine that some may not support routed subnets over PPPoE. I'm a customer and big RouterOS fan, so I don't need to care about these things, RouterOS can do it and that's all I need. :)
Thanks Sob,

We are an ISP and we use Mikrotik devices as a network termination unit. This is where the customers PPPOE session terminates. The NTU then has DHCP server running on the lan interface which gives out a single /30 address to the customers home wifi router that they supply.

For business customers, We intend to do the same thing although they may require static public IP's. In this case we would static route the IP public subnet to the PPPOE client and assign one of these addresses to the local interface of the NTU. Its then up to the customer to decide how they want to use these addresses.

Thoughts?

Who is online

Users browsing this forum: AndHe, Bing [Bot], djvabe, pajapatak and 125 guests