How to configure ipvlan?

Hi All,

my provider gave me 3 configuration for single ethernet uplink. I can use any of them separately no problem.

Now I'd like to setup 2 configuration simultaneously. I have tried to use kmod-macvlan, create bridged macvlan device and configure 2-nd WAN interface with the new device. It didn't work. Only the recently restarted interface got connection to internet. My guess is that I can't use multiple MAC on my uplink.

I have found package kmod-ipvlan, which seems to be an alternative solution. Unfortunately I can't find any info on how to use this package. I don't know how to create a valid ipvlan device. I have installed kmod-ipvlan and then I have tried to create bridged device on wan or to create 2 interfaces on wan device, but the result is like with macvlan, only one interface gets connection.

Any help with this configuration would be appreciated.

What device?
What configuration?

Are you sure vlans are what you're looking for?

There's no point in using vlans for that. ISP vlans are used e.g. for separating VoIP and IPTV from regular traffic because you clearly want to prioritize those with QoS to never have stuttering due to huge torrent usage or whatever. If you think of "this needs to go through a dedicated wire" or "this needs to be physically routed in another direction", then vlans are the way to go. But only providing a couple of IP addresses to a single client doesn't require vlans.

My suggestion would be network interface aliases.


Create a "wan" interface with the first IP address, bound to eth0 as ifname (or whatever name your uplink port has).
Create a "wan2" interface with the second IP address and use "@wan" (so an at sign followed by the name of the first interface name) as ifname.
Create a "wan3" interface with the third IP address and use "@wan" as ifname here as well.

This will create three different network interfaces and have all of them use the same uplink wire with no vlan.

The thing is: You can even have your "wan" a "pppoe" connection (like the ones you use for DSL with credentials) and still have "@wan" for the others, resulting in all three interfaces using the one login part of the first interface.

If you really want to set up vlans you will need to provide more information about how your ISP has told you to set this up.

And maybe provide your current /etc/config/network file.


Thanks for advice. Aliases works!

FYI: I'm using Openwrt 22.03.3 on Netgear R6220. My 3 configurations differ by external routes. I received these configurations, because fist one got problems with VPN connection. Currently I'm using interface without public IP and I'm trying to add a second one, which gets a public IP.

Now ping to public IP works, so I'm going to try to set up FTP on this interface.

No, it is more complicated. I can't get main traffic by first interface and ping to second interface.

I have configured 2 interfaces, first with wan device, second with @wan device. Both interfaced are placed at wan firewall zone. I have set "use gateway metrics" on each interface. Traffic goes by interface with lower metric, but I can't ping second interface if it have higher metrics.

I'm trying to get some ideas form mwan3:

but I don't know enough to make it works for me.