Set wired device to use another interface

Hello,
I've created new interface, that uses ip pool 192.168.2.1/24 and I wanted to ask how to add a device, that is using wire. WiFi devices can already connect but I would love to use this pool on my computer too since I want to manipulate with Chromecast.
Thank you very much,
Jakub.

Add a physical interface either in Luci or in UCI with option ifname ethx.y
If you need more help with that, you would need to post the network config of yours.

Hello, this option is already there.

Here is my network config

/etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd5c:30ae:45dd::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option ip6assign '60'
        option igmp_snooping '1'
        list dns '1.1.1.1'
        list dns '1.0.0.1'
        option netmask '255.255.255.0'
        option ifname 'eth0 eth0.1'

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr 'f0:79:59:e6:c3:00'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'static'
        option ipaddr '10.118.11.8'
        option gateway '10.118.11.1'
        option dns '1.1.1.1 1.0.0.1'
        option netmask '255.255.255.0'

config device 'wan_dev'
        option name 'eth0.2'
        option macaddr 'f0:79:59:e6:c3:01'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '6t 1 2 3 4'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option vid '2'
        option ports '6t 0'

config interface 'private'
        option type 'bridge'
        option proto 'static'
        option stp '1'
        option netmask '255.255.255.0'
        list dns '1.1.1.1'
        list dns '1.0.0.1'
        option ipaddr '192.168.2.1'
        option igmp_snooping '1'
        option ifname 'eth0 eth0.1'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/10180000.wmac'
        option channel '8'
        option htmode 'HT40'
        option country 'CZ'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option ssid 'kasparovi'
        option key '<ReallySecretPassword>'
        option wpa_disable_eapol_key_retries '1'
        option network 'lan'
        option encryption 'psk2'

config wifi-iface 'wifinet1'
        option wpa_disable_eapol_key_retries '1'
        option key '<ReallySecretPassword>'
        option ssid 'kaspar-private'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'ap'
        option network 'private'
        option macfilter 'allow'
        list maclist 'F0:79:59:E6:C3:01'
        list maclist 'A4:50:46:6A:B7:E1'
        list maclist 'F0:EF:86:1A:C4:1A'
        option hidden '1'

You'll need this:

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '6t 2 3 4'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option vid '3'
        option ports '6t 1'

config interface 'private'
        option type 'bridge'
        option proto 'static'
        option stp '1'
        option netmask '255.255.255.0'
        option ipaddr '192.168.2.1'
        option igmp_snooping '1'
        option ifname 'eth0.3'

Also remove eth0 from option ifname and the dns 1.1.1.1, 1.0.0.1 in lan interface

2 Likes

Thank you so much :blush:
It's working :innocent:

1 Like

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