Static IP Wan over veth (kmod-macvlan)

Hi here,
I need to add a WAN interface having a static IP address and share it with the LAN. I need a total of 3 WAN ports. For 2 of them, I assigned 2 physical interfaces and it works okay. If I assign 3-rd physical interface for WAN, it works okay as well.
However, I want to free up one Lan port and do something like this.

Since I'm using mwan3, I set up kmod-macvlan.

config device 'veth5'
    option name 'veth5'
    option type 'macvlan'
    option ifname 'eth0'

config interface 'wanc'
	option ifname 'veth5'
	option proto 'static'
	option netmask ''
	option ip6assign '60'
	option ipaddr ''
	option metric '10'

WANC is attached to the same firewall group as other wans.

Pinging through this interface gives no results.

tcpdump shows only

12:13:06.260460 ARP, Request who-has tell, length 28'

ifconfig shows

veth5     Link encap:Ethernet  HWaddr F2:E1:92:5F:AE:29
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::f0e1:92ff:fe5f:ae29/64 Scope:Link
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:724 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:30860 (30.1 KiB)

Where I should look into? Also, is kmod-macvlan is a good way to go?

Is the eth0 ifname correct? Isn't there any subinterface for the lan?
Also the wanc is missing the gateway, but you should fix the ifname first.

1 Like

Hi @trendy

I had the same concerns. Here is my LVAN setup.

eth0.1 has a static interface and bridged with the WiFi and has LAN default firewall rules.

If I try to run ip link add link eth0.1 eth20 type macvlan

I'm getting RTNETLINK answers: Resource busy

I tried ip link set down eth0.1 && ip link add link eth0.1 eth20 type macvlan && ip link set up eth0.1 but have the same results.

What it could be? Sorry, I'm pretty new to networking and OpenWRT.

Here is my "Interfaces" setup.

Then you should use the eth0.1 as ifname in the macvlan configuration as described here.

1 Like

Oh man, it seems I have to use br-lan instead of eth0.1. I set it up that way and it's working!

@trendy thanks for looking into it. I'm really appreciate it.

1 Like

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