How to create a virtual network interface in OpenWrt

Hi all,

Here my Openwrt running on atheros7k/9k with only one ethernet interface, the main logic as below,

Now this setting works perfect to routing between wifi and ethernet world. The bridge setting as below,

config interface 'nw1'
        list ifname 'eth0'
        list ifname 'r1_mesh1.1'
        option vlan_id '1'
        option type 'bridge'
        option reqopts '66'
        option netmask '255.255.255.0'
        option igmp_snooping '0'
        option ip6assign '60'
        option name 'infrastructure'
        option enabled '1'
        option priority '0'
        list dns '0.0.0.0'
        list dns '0.0.0.0'
        option hostname 'xxxx_FFFF'
        option proto 'static'
        option ipaddr '172.16.3.118'

Now I need to add an another virtual network interface, not related with wifi ap, but just a network interface which could hold its own static ip or DHCP. As above, the traffic would be through the bridge as well. Any idea please kindly let me know. Thanks advance.

I used to try to create an another bridge with IP address and MAC address, and use relayd to do forwarding between these two bridges. However relayd gets the CPU consumption really high. So I have to give up the path with relayd.

Hi there,

If anybody has any idea, please kindly let me know.

You can create an alias to the eth0

config interface 'nw2'
        list ifname 'eth0'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option proto 'static'
        option ipaddr '192.168.1.1'

It might as well be bound to loopback interface.

2 Likes

Hi trendy,

Thanks for your reply. A question, could we assign a new mac address for such an alias? Thanks.

https://openwrt.org/packages/pkgdata/kmod-dummy

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