Community discussions

 
880frank
just joined
Topic Author
Posts: 1
Joined: Thu Jan 29, 2015 4:52 pm

Virtual or pseudo ethernet interfaces possible?

Thu Jan 29, 2015 5:15 pm

Hello,

from my cable provider i could get 5 fixed ip addresses via DHCP - but i have to gave them the interface mac address upfront. The cisco cable modem is connected to ethernet port 1.
Is there a way to create additonal Interfaces including DHCP clients with independent mac addresses but linked to the same physical Interface?

If there is a trick - please advidse

thank you,

frank
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 780
Joined: Tue Aug 03, 2004 9:01 am

Re: Virtual or pseudo ethernet interfaces possible?

Fri Jan 30, 2015 2:58 pm

No good way to do this that I know.

There is a virtual-ethernet interface (vif), but its purpose is to allow communication between host router and virtualized router (either KVM on x86, or MetaROUTER on MIPSBE and single-core Freescale PowerPC), so not all boxes that run RouterOS will show you the option.

In theory, on a RouterOS device that does have support for '/interface virtual-ethernet', you could create a bunch, just not use them with a virtual router, and bridge all of them together, or for router models that don't support this interface type, you could create a bunch of some other ethernet-like interface that is essentially virtual (e.g., EoIP) and bridge THOSE together. But all direct member interfaces of a bridge will assume the bridge's MAC address and not their own when transmitting frames, so you would still be stuck with a single MAC address. To transmit individual, unique MAC addresses, the bridge has to be forwarding frames, not originating/outputting frames, which still means multiple devices.

If you *are* using a router that has support for virtualization (KVM or MetaROUTER), the easiest way is to fire up one virtual router per IP address and dump them all in a bridge with your WAN port on the host. But that does seem a bit excessive to be running 4 or 5 virtual routers just to do this.

One final possibility that you might investigate is to do as suggested earlier and create a bunch of virtual ethernet-like interfaces and bridge them with the WAN port, and then use '/interface bridge nat' to construct L2 NAT rules to change the MAC address used on frame transmission. This might get complex rather quickly, though, and may even be impossible, since bridge NAT is basically stateless (no tracking of any kind) and the specific matchers that you might need to translate the MAC address on egress and ingress may not even exist.

-- Nathan
 
Sob
Forum Guru
Forum Guru
Posts: 3576
Joined: Mon Apr 20, 2009 9:11 pm

Re: Virtual or pseudo ethernet interfaces possible?

Sat Jan 31, 2015 4:55 pm

It seems that it's possible to misuse VRRP for that:

ros code

/interface vrrp
add interface=ether1 name=vrrp1 vrid=1
add interface=ether1 name=vrrp2 vrid=2
add interface=ether1 name=vrrp3 vrid=3
# VRRP interface needs some static address to come up:
/ip address
add address=127.0.0.2/32 interface=vrrp1 network=127.0.0.2
add address=127.0.0.3/32 interface=vrrp2 network=127.0.0.3
add address=127.0.0.4/32 interface=vrrp3 network=127.0.0.4
/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no \
    interface=ether1
add add-default-route=no dhcp-options=hostname,clientid disabled=no interface=\
    vrrp1 use-peer-dns=no use-peer-ntp=no
add add-default-route=no dhcp-options=hostname,clientid disabled=no interface=\
    vrrp2 use-peer-dns=no use-peer-ntp=no
add add-default-route=no dhcp-options=hostname,clientid disabled=no interface=\
    vrrp3 use-peer-dns=no use-peer-ntp=no
It's definitely not a proper solution and I'm not sure about all possible side effects. But at the first sight, it works:

ros code

Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                       
 0   127.0.0.2/32       127.0.0.2       vrrp1                           
 1   127.0.0.3/32       127.0.0.3       vrrp2                           
 2   127.0.0.4/32       127.0.0.4       vrrp3                           
 3 D 192.168.80.50/24   192.168.80.0    ether1                          
 4 D 192.168.80.48/24   192.168.80.0    vrrp2                           
 5 D 192.168.80.47/24   192.168.80.0    vrrp3                           
 6 D 192.168.80.49/24   192.168.80.0    vrrp1
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 780
Joined: Tue Aug 03, 2004 9:01 am

Re: Virtual or pseudo ethernet interfaces possible?

Sun Feb 01, 2015 2:06 am

It seems that it's possible to misuse VRRP for that: [snip]
Clever!!!

-- Nathan
 
Mett
newbie
Posts: 25
Joined: Sat Mar 12, 2016 10:15 pm

Re: Virtual or pseudo ethernet interfaces possible?

Mon Mar 14, 2016 10:23 am

Hello,

I've got the same problem. My idea was now connecting the router through eth1 to the DOCSIS-Modem und bridging (or switching) eth2 with another MAC to eth1. So there is one physical connection between router and modem but two logical connections. So eth1 gets the static IP (ISP assigns a static IP to a certain MAC), eth2 gets a dynamic IP.
forum.mikrotik@honig.do0.de
 
FunctionalIT
just joined
Posts: 1
Joined: Fri Oct 21, 2016 10:45 am

Re: Virtual or pseudo ethernet interfaces possible?

Fri Oct 21, 2016 10:56 am

For all whom want to create a similar infrastructure. I have done this succesfully with VRRP, but this is kind of an abuse and has some flaws. You can do it with MetaRouter (if available), but that is a bit heavy for the system and the IP's will virtually be on different routers.
The easiest (and best) way to do this is to put a switch in front (between modem and router) and offer a physical interface to every IP...
 
jarda
Forum Guru
Forum Guru
Posts: 7562
Joined: Mon Oct 22, 2012 4:46 pm

Re: Virtual or pseudo ethernet interfaces possible?

Fri Oct 21, 2016 12:11 pm

Yep. To put switch in front of the router, that's bingo! At least meanwhile until mikrotik come with some real and usable solution. Maybe abusing eoip tunnels to some other device and back could do the job also.
 
User avatar
Jotne
Forum Veteran
Forum Veteran
Posts: 796
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Virtual or pseudo ethernet interfaces possible?

Sat Sep 01, 2018 7:07 pm

I did try vrrp config on an hAP lite.
Vrrp interface are all red (all config added)
Did try the same on hEX 750Gr3 interface did came up.
But all did get the same IP from my ISP.
.
Use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
Sob
Forum Guru
Forum Guru
Posts: 3576
Joined: Mon Apr 20, 2009 9:11 pm

Re: Virtual or pseudo ethernet interfaces possible?

Sun Sep 02, 2018 2:59 pm

It depends on what ISP does. The idea here was that ISP is willing to provide multiple addresses to devices directly connected to WAN. Is it your case? Multiple devices = multiple MAC addresses, VRRP can provide those. But it won't just work everywhere, when you're not supposed to get more than one address.
 
User avatar
Jotne
Forum Veteran
Forum Veteran
Posts: 796
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Virtual or pseudo ethernet interfaces possible?

Thu Sep 20, 2018 7:54 am

I did just try to connect ether1 to an Router with DHCP. So this router should give away IP to any who ask.
Stil red DHCP interfaces.
Tested on rb951g-2hnd and CRS-125-24G
.
Use Splunk to monitor your MikroTik Router

MikroTik->Splunk

Who is online

Users browsing this forum: timotei, wispmikrotik and 55 guests