Maybe not a beginner question, but since I am a MikroTik beginner, I think it is valid here. Currently, I am using OPNsense as my Router/Firewall and want to replace it with a CCR2116. To test RouterOS and its features before changing my network, I am using GNS3 with virtual Cloud Hosted Router with RouterOS v7.6.
I get the following info from my ISP for my network:
IPv4 Subnet: x.y.z.0/28, Netmask: 255.255.255.240, Gateway: x.y.z.1
I also get a /64 IPv6 Prefix, but want to understand how to set up IPv4 first.
My Goal is to assign the /28 IPv4 Subnet to my WAN interface ether1, but I don’t know where I can set the upstream gateway IP.
To Test this out, I am using the cgNAT IP Net 100.64.31.0/28 with 2 CHRs called ProviderEdge and CoreRouter connected like this:
Internet <==> [ether1] ProviderEdge [ether2] <==> [ether1] CoreRouter [ether2] <==> Client Server
# ProviderEdge
/ip/address/add address=100.64.31.1/28 interface=ether2
# CoreRouter
/ip/address/add address=100.64.31.2/28 interface=ether1
I can ping both routers from each other, but how do I set 100.64.31.1 as the upstream gateway for CoreRouter?
Is this somehow detected automatically or assumed to be the first IP of the subnet?
How do I use the other 13 IPs from the /28 Subnet? On OPNsense I would simply create an IP alias and add a firewall rule for an IP of that subnet, for example 100.64.31.3.
Is there something similar to this in RouterOS? I added a Firewall Rule on the CoreRouter but am unable to ping that IP from ProviderEdge:
/ip/firewall/filter/add action=accept chain=input dst-address=100.64.31.3 protocol=icmp src-address=0.0.0.0
Edit:
I found a way to use the additional subnet IPs using veth interface:
/interface/veth/add address=100.64.31.3/28 gateway=100.64.31.2 name=ether1_ip3
/ip/address/add address=100.64.31.3 interface=ether1_ip3 network=100.64.31.0
Is that the right way of doing that?
