Multiple static interface on same Physical Ethernet

I would like some help to setup a configuration where I have physically 3 different acces to internet, attached to 3 different static Gateway /IP

All is attached to the same Ethernet cable,connected to the WAN port of my Opewrt routeur (Xiaomi R3P 19.7)

Today I created 3 interfaces attached to the same device eth0.2

This is "working" But I would like to go further, with having 3 Virtual Ethernet port or something like that to have 3 different Mac address.

I would like to create either
1/ 3 Virtual ethernet
2/ 1 virtual switch with 3 vlans

Is someone has some direction to give to me .
this how it's done

Thanks for you guidance on how to create
3 ethernet virtual Devices
Make them attached to the physical eth0.2

With single wan port is possible create virtual eths with kmod-macvlan.[]=macvlan

Yes I have this package installed and working and I followed installation instruction
1/ all interface status rely on the first WAN o do the ping (if WAN is falling all the ping for tracking are done) as all ping are done through eth0.2 which has a default routing by the main of lowest metric interface.
==> that's what I want to have a separation with also the ethernet device and not only 3 interface on the same device

2/ I've tryied to install Macvlan, but the way it's presented inthe odc is not giving results
==> the virtual device created is not reconized by ping command so the tracking is also giving a fail and the rules of Mwan3 is not working
At least on my routeur the name of the macvlan interfaces is not reconnized by ping command
if I 'm creating a mcvlan inteface like that

config device 'veth5_dev'
  option name 'veth5'
  option type 'macvlan'
  option ifname 'eth0.2'

config interface 'wan1'
	option ifname 'veth5'
	option netmask ''
	option gateway ''
	option ipaddr ''
	option metric '20'

The ping done by Mwan3 is giving an error
as it is not recognising the device 'veth5'

ping -c 1 -I veth5

Is giving an error
Or I missed something

I was having the believ that having a switch AND macvlan on the same device is less easy to configure and bringing more trouble

Is someone ha a working configuration to share ?

Apply this correction:

My two cents:

  • If the "hub" was a managed switch, you could use VLANs and have each modem isolated from each other. Or you could reconfigure the router, connect each modem to a LAN port, and use the WAN port for your internal network, using that "hub". Both seem much cleaner than playing with MACs.
  • Looks like all three modems are configured as routers, so you get a private IP address from each of them, and double-NAT for your internal network. I would try to configure them as bridges, so your router has three pubic IP addresses.

It worked
thanks for your advise


If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.