Need help assigning public IP segments to customers

Hello Mikrtoik Community, I need your help.
I already have Mikrotik experience, but this is the first time I face this configuration, and so far, I’ve been unsuccessful.
Connection Diagram:
ISP->RB1200->Switch->N Customers
What I want to do:
I want to give each of my customers a /29.
My ISP gives me the following parameters:
WAN: 201.158.16.76/30
Gateway: 201.158.16.77
And I am configuring 201.158.16.78 for the RB1200.
They are also giving me the following IP segment to distribute between my customers:
201.158.19.0/24
How can I do this?
Customer 1: 201.158.19.16/29
Customer 2: 201.158.19.24/29
Ignore the switch for the moment; assume I am connecting my customers directly to the RB1200.

hello..

you can try this, http://wiki.mikrotik.com/wiki/Manual:Interface/EoIP

Is this to assigned to “ether1”?

They are also giving me the following IP segment to distribute between my customers:
201.158.19.0/24
How can I do this?
Customer 1: 201.158.19.16/29
Customer 2: 201.158.19.24/29
Ignore the switch for the moment; assume I am connecting my customers directly to the RB1200.

Are you providing any DHCP to your customers, for these (/29) address blocks ?

This might be a place to start… I’ve only filled out the first four interfaces (ether2-ether5), but you’ll get the idea. I haven’t tested it, but try it and see if this is a good starting point for your customer nets.



/interface bridge
add admin-mac=00:00:00:00:00:00 ageing-time=5m arp=enabled auto-mac=yes
disabled=no forward-delay=15s l2mtu=65535 max-message-age=20s mtu=1500
name=Loopback priority=0x8000 protocol-mode=none transmit-hold-count=6


/ip pool
add name=ether2 ranges=201.158.19.2-201.158.19.6
add name=ether3 ranges=201.158.19.10-201.158.19.14
add name=ether4 ranges=201.158.19.18-201.158.19.22
add name=ether5 ranges=201.158.19.26-201.158.19.30

/ip dhcp-server
add add-arp=yes address-pool=ether2 always-broadcast=yes authoritative=
after-2sec-delay bootp-support=static disabled=no interface=ether2
lease-time=3d name=server1
add add-arp=yes address-pool=ether3 always-broadcast=yes authoritative=
after-2sec-delay bootp-support=static disabled=no interface=ether3
lease-time=3d name=server2
add add-arp=yes address-pool=ether4 always-broadcast=yes authoritative=
after-2sec-delay bootp-support=static disabled=no interface=ether4
lease-time=3d name=server3
add add-arp=yes address-pool=ether5 always-broadcast=yes authoritative=
after-2sec-delay bootp-support=static disabled=no interface=ether5
lease-time=3d name=server4

/routing ospf instance
set default disabled=no distribute-default=never in-filter=ospf-in
metric-bgp=auto metric-connected=20 metric-default=1 metric-other-ospf=
auto metric-rip=20 metric-static=20 name=default out-filter=ospf-out
redistribute-bgp=no redistribute-connected=no redistribute-other-ospf=no
redistribute-rip=no redistribute-static=no router-id=10.0.1.254

/routing ospf area
set backbone area-id=0.0.0.0 disabled=no instance=default name=backbone type=
default
add area-id=0.0.0.0 disabled=no instance=default name=area10 type=default
add area-id=0.0.0.1 disabled=no instance=default name=area11 type=default
add area-id=0.0.0.2 disabled=no instance=default name=area12 type=default
add area-id=0.0.0.3 disabled=no instance=default name=area13 type=default

/ip address
add address=201.158.19.1/29 disabled=no interface=ether2 network=201.158.19.0
add address=201.158.19.9/29 disabled=no interface=ether3 network=201.158.19.8
add address=201.158.19.17/29 disabled=no interface=ether4 network=201.158.19.16
add address=201.158.19.25/29 disabled=no interface=ether5 network=201.158.19.24
add address=201.158.19.254/32 disabled=no interface=Loopback network=201.158.19.254

/ip dhcp-client
add default-route-distance=0 disabled=no interface=ether1

/ip dhcp-server config
set store-leases-disk=5m

/ip dhcp-server network
add address=201.158.19.0/29 gateway=201.158.19.1
add address=201.158.19.8/29 gateway=201.158.19.9
add address=201.158.19.16/29 gateway=201.158.19.17
add address=201.158.19.24/29 gateway=201.158.19.25

/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB
max-udp-packet-size=512 servers=172.16.11.1 <----- Change this to whatever you use for dns

/ip firewall nat
add action=masquerade chain=srcnat disabled=no src-address=201.158.19.0/29
add action=masquerade chain=srcnat disabled=no src-address=201.158.19.8/29
add action=masquerade chain=srcnat disabled=no src-address=201.158.19.16/29
add action=masquerade chain=srcnat disabled=no src-address=201.158.19.24/29

/routing ospf network
add area=area0 disabled=no network=201.158.19.0/29
add area=area1 disabled=no network=201.158.19.8/29
add area=area2 disabled=no network=201.158.19.16/29
add area=area3 disabled=no network=201.158.19.24/29
add area=backbone disabled=no network=0.0.0.0/0

Yes, ether1 will be my WAN port to my ISP.

No. They will use fixed IP. They can use any of the IP segment I give them as they please.
Thank you for your help and sorry for taking long to reply.

interface customers connect to:
set ip to 201.158.19.1 , customers use this as their default gateway.

WAN interface set to an ip in the range you are assigned by ISP

Then add routes to the interface customers connect to:
e.g:
destination:201.158.19.16/29 interface: ethCustomers
destination:201.158.19.24/29 interface: ethCustomers etc.

make sure to add a 0.0.0.0 route to the WAN interface on your RB and the customer’s.

customer CPE: assign the IPs in their range one by one to their WAN interface. then let them do the rest :slight_smile:

Hope I haven’t missed anything :confused:

Tony