How to setup VLANs per interfaces on Linksys WRT 1900 acs OpenWRT (Chaos Calmer 15.05.1)












2















OS: OpenWRT, Chaos Calmer 15.05.1 (stable release with luci GUI)
Router: Linksys WRT 1900ACS (2x1.6Ghz, 512MB of RAM)



Problem: I am trying to set up separate VLANs per LAN interfaces (LAN ports). Strange but I cannot see any switch options in "luci" --> Networks; menu doesn't exist.



I tried to modify /etc/config/network by adding config switch for switch0, but I am losing access to my router after every /etc/init.d/network reload.



What I am trying to achieve:



Lan Port 1 --> VLAN 1;
Lan Port 2 --> VLAN 2;
Lan Port 3 --> VLAN 3;
Lan Port 4 --> VLAN 3;
Wireless --> VLAN 4;


Default /etc/config/network looks like below:



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 'fd61:03fe:3974::/48'

config interface 'lan'
option ifname 'eth1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'


I tried adding switch into configuration after reviewing OpenWRT wiki with no luck.



My switch device name:



root@OpenWrt:~# swconfig list
Found: switch0 - 10.mvsw61xx


I would appreciate any input.










share|improve this question





























    2















    OS: OpenWRT, Chaos Calmer 15.05.1 (stable release with luci GUI)
    Router: Linksys WRT 1900ACS (2x1.6Ghz, 512MB of RAM)



    Problem: I am trying to set up separate VLANs per LAN interfaces (LAN ports). Strange but I cannot see any switch options in "luci" --> Networks; menu doesn't exist.



    I tried to modify /etc/config/network by adding config switch for switch0, but I am losing access to my router after every /etc/init.d/network reload.



    What I am trying to achieve:



    Lan Port 1 --> VLAN 1;
    Lan Port 2 --> VLAN 2;
    Lan Port 3 --> VLAN 3;
    Lan Port 4 --> VLAN 3;
    Wireless --> VLAN 4;


    Default /etc/config/network looks like below:



    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 'fd61:03fe:3974::/48'

    config interface 'lan'
    option ifname 'eth1'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

    config interface 'wan'
    option ifname 'eth0'
    option proto 'dhcp'


    I tried adding switch into configuration after reviewing OpenWRT wiki with no luck.



    My switch device name:



    root@OpenWrt:~# swconfig list
    Found: switch0 - 10.mvsw61xx


    I would appreciate any input.










    share|improve this question



























      2












      2








      2


      2






      OS: OpenWRT, Chaos Calmer 15.05.1 (stable release with luci GUI)
      Router: Linksys WRT 1900ACS (2x1.6Ghz, 512MB of RAM)



      Problem: I am trying to set up separate VLANs per LAN interfaces (LAN ports). Strange but I cannot see any switch options in "luci" --> Networks; menu doesn't exist.



      I tried to modify /etc/config/network by adding config switch for switch0, but I am losing access to my router after every /etc/init.d/network reload.



      What I am trying to achieve:



      Lan Port 1 --> VLAN 1;
      Lan Port 2 --> VLAN 2;
      Lan Port 3 --> VLAN 3;
      Lan Port 4 --> VLAN 3;
      Wireless --> VLAN 4;


      Default /etc/config/network looks like below:



      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 'fd61:03fe:3974::/48'

      config interface 'lan'
      option ifname 'eth1'
      option force_link '1'
      option type 'bridge'
      option proto 'static'
      option ipaddr '192.168.1.1'
      option netmask '255.255.255.0'
      option ip6assign '60'

      config interface 'wan'
      option ifname 'eth0'
      option proto 'dhcp'


      I tried adding switch into configuration after reviewing OpenWRT wiki with no luck.



      My switch device name:



      root@OpenWrt:~# swconfig list
      Found: switch0 - 10.mvsw61xx


      I would appreciate any input.










      share|improve this question
















      OS: OpenWRT, Chaos Calmer 15.05.1 (stable release with luci GUI)
      Router: Linksys WRT 1900ACS (2x1.6Ghz, 512MB of RAM)



      Problem: I am trying to set up separate VLANs per LAN interfaces (LAN ports). Strange but I cannot see any switch options in "luci" --> Networks; menu doesn't exist.



      I tried to modify /etc/config/network by adding config switch for switch0, but I am losing access to my router after every /etc/init.d/network reload.



      What I am trying to achieve:



      Lan Port 1 --> VLAN 1;
      Lan Port 2 --> VLAN 2;
      Lan Port 3 --> VLAN 3;
      Lan Port 4 --> VLAN 3;
      Wireless --> VLAN 4;


      Default /etc/config/network looks like below:



      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 'fd61:03fe:3974::/48'

      config interface 'lan'
      option ifname 'eth1'
      option force_link '1'
      option type 'bridge'
      option proto 'static'
      option ipaddr '192.168.1.1'
      option netmask '255.255.255.0'
      option ip6assign '60'

      config interface 'wan'
      option ifname 'eth0'
      option proto 'dhcp'


      I tried adding switch into configuration after reviewing OpenWRT wiki with no luck.



      My switch device name:



      root@OpenWrt:~# swconfig list
      Found: switch0 - 10.mvsw61xx


      I would appreciate any input.







      openwrt vlan






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 17 at 20:23









      Hennes

      59.2k792142




      59.2k792142










      asked Apr 4 '16 at 18:21









      TomTom

      1114




      1114






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Check out a solution and basic config example to get VLANs working on WRT1200AC using OpenWRT Chaos Calmer 15.05.1 here https://forum.openwrt.org/viewtopic.php?pid=332010#p332010



          BEWARE: The example is for WRT1200AC v1 / WRT1900AC v2 / WRT1900ACS v1.



          For WRT1900AC v1 entries for "eth0" and "eth1" need to be SWAPPED.



          See https://wiki.openwrt.org/toh/linksys/wrt1x00ac_series to identify your router model.



          As you noted, getting the config wrong leaves you highly likely to brick your router. So be careful! I made sure SSH login was possible via wireless before proceeding to change LAN port setup.



          From the forum link:



          You can easily brick your router if you don't set the interfaces exactly right, and it's not intuitive. You MUST set WAN port to use "eth0.(vlan_number)" eg: "eth0.100" and the other external ports to use "eth1.(vlan_number)" eg: "eth1.2", even though WAN and LAN ports share the same switch and same VLAN config.



          You must use the "t" tagged flag for the ports which the CPU connects to (5 on eth0 and 6 on eth1). So take careful note of the "5t" and "6t" in my example config below. Advice that is missing the essential "t" beside those entries did not work for me.



          Also for some reason I found WAN had to use a specially set VID of 100 (or any number that isn't 1, and doesn't conflict with your other vlan numbers), while the VLAN itself must still be set to 1. See the example below.



          Lastly, do NOT use Luci to configure the switch (eg: Network > Switch in the Luci inteface). You must edit /etc/config/network by hand to change the switch and VLAN definition. Luci will make a mess of switch and VLAN config. It autodetects the VLANs incorrectly when defining interface physical connections. It will try to call them all "eth0.1, eth0.2, eth0.3.." and so on, when in fact you must use "eth1.X" for all LAN ports and "eth0.X" for the WAN port. Using Luci's Network > Interface > (Interface Name) > Physical Settings config page is fine as long as you ignore the VLANs that Luci autodetects and type the correct ones using the "Custom Interface" box to define them the first time.



          If I failed to do any one of these things, all the ports became unusable. I found that as long as I had SSH access set up to be accessible via the wifi connection, I was able to recover from mistakes easily enough.



          My working config, with WAN and each LAN port on its own VLAN (Ports labelled as 3 and 4 on the back of the device are defined here but currently unassigned to any network):



          /etc/config/network:



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

          #wan port
          config switch_vlan
          option device 'switch0'
          option vlan '1'
          option vid '100'
          option ports '4 5t'

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

          #port 2
          config switch_vlan
          option device 'switch0'
          option vlan '3'
          option vid '3'
          option ports '2 6t'

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

          #port 4
          config switch_vlan
          option device 'switch0'
          option vlan '5'
          option vid '5'
          option ports '0 6t'

          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 ' ( ...whatever your prefix is... ) '

          #Lan on switch port 1
          config interface 'lan'
          option force_link '1'
          option proto 'static'
          option netmask '255.255.255.0'
          option ipaddr '192.168.0.1'
          option ifname 'eth1.2'

          #Another local network on switch port 2
          config interface 'someothernetwork'
          option proto 'static'
          option ifname 'eth1.3'
          option ipaddr '192.168.8.1'
          option netmask '255.255.255.0'

          #WAN on the wan port
          config interface 'wan'
          option ifname 'eth0.100'
          option proto 'dhcp'

          #Wireless
          config interface 'wi'
          option type 'bridge'
          option _orig_ifname 'wlan0 wlan1'
          option _orig_bridge 'true'
          option proto 'static'
          option ipaddr '192.168.6.1'
          option netmask '255.255.255.0'





          share|improve this answer

































            0














            FYI. I applied the same configuration as specified by @AdrianQ on my Linksys 1900AC v2 router running OpenWRT (18.06.02) and it also worked on this device.



            This makes sense as both the WRT1900AC(v2) and WRT1900ACS routers use the same Marvell 88E6176 ethernet switch and so share the same switch port layout. See device VLAN switch port references:




            • https://openwrt.org/toh/linksys/linksys_wrt1900ac#switch_ports_for_vlans

            • https://openwrt.org/toh/linksys/linksys_wrt1900acs#switch_ports_for_vlans






            share|improve this answer










            New contributor




            Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















            • What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

              – Scott
              yesterday











            • @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

              – Michael
              yesterday











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1061327%2fhow-to-setup-vlans-per-interfaces-on-linksys-wrt-1900-acs-openwrt-chaos-calmer%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Check out a solution and basic config example to get VLANs working on WRT1200AC using OpenWRT Chaos Calmer 15.05.1 here https://forum.openwrt.org/viewtopic.php?pid=332010#p332010



            BEWARE: The example is for WRT1200AC v1 / WRT1900AC v2 / WRT1900ACS v1.



            For WRT1900AC v1 entries for "eth0" and "eth1" need to be SWAPPED.



            See https://wiki.openwrt.org/toh/linksys/wrt1x00ac_series to identify your router model.



            As you noted, getting the config wrong leaves you highly likely to brick your router. So be careful! I made sure SSH login was possible via wireless before proceeding to change LAN port setup.



            From the forum link:



            You can easily brick your router if you don't set the interfaces exactly right, and it's not intuitive. You MUST set WAN port to use "eth0.(vlan_number)" eg: "eth0.100" and the other external ports to use "eth1.(vlan_number)" eg: "eth1.2", even though WAN and LAN ports share the same switch and same VLAN config.



            You must use the "t" tagged flag for the ports which the CPU connects to (5 on eth0 and 6 on eth1). So take careful note of the "5t" and "6t" in my example config below. Advice that is missing the essential "t" beside those entries did not work for me.



            Also for some reason I found WAN had to use a specially set VID of 100 (or any number that isn't 1, and doesn't conflict with your other vlan numbers), while the VLAN itself must still be set to 1. See the example below.



            Lastly, do NOT use Luci to configure the switch (eg: Network > Switch in the Luci inteface). You must edit /etc/config/network by hand to change the switch and VLAN definition. Luci will make a mess of switch and VLAN config. It autodetects the VLANs incorrectly when defining interface physical connections. It will try to call them all "eth0.1, eth0.2, eth0.3.." and so on, when in fact you must use "eth1.X" for all LAN ports and "eth0.X" for the WAN port. Using Luci's Network > Interface > (Interface Name) > Physical Settings config page is fine as long as you ignore the VLANs that Luci autodetects and type the correct ones using the "Custom Interface" box to define them the first time.



            If I failed to do any one of these things, all the ports became unusable. I found that as long as I had SSH access set up to be accessible via the wifi connection, I was able to recover from mistakes easily enough.



            My working config, with WAN and each LAN port on its own VLAN (Ports labelled as 3 and 4 on the back of the device are defined here but currently unassigned to any network):



            /etc/config/network:



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

            #wan port
            config switch_vlan
            option device 'switch0'
            option vlan '1'
            option vid '100'
            option ports '4 5t'

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

            #port 2
            config switch_vlan
            option device 'switch0'
            option vlan '3'
            option vid '3'
            option ports '2 6t'

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

            #port 4
            config switch_vlan
            option device 'switch0'
            option vlan '5'
            option vid '5'
            option ports '0 6t'

            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 ' ( ...whatever your prefix is... ) '

            #Lan on switch port 1
            config interface 'lan'
            option force_link '1'
            option proto 'static'
            option netmask '255.255.255.0'
            option ipaddr '192.168.0.1'
            option ifname 'eth1.2'

            #Another local network on switch port 2
            config interface 'someothernetwork'
            option proto 'static'
            option ifname 'eth1.3'
            option ipaddr '192.168.8.1'
            option netmask '255.255.255.0'

            #WAN on the wan port
            config interface 'wan'
            option ifname 'eth0.100'
            option proto 'dhcp'

            #Wireless
            config interface 'wi'
            option type 'bridge'
            option _orig_ifname 'wlan0 wlan1'
            option _orig_bridge 'true'
            option proto 'static'
            option ipaddr '192.168.6.1'
            option netmask '255.255.255.0'





            share|improve this answer






























              2














              Check out a solution and basic config example to get VLANs working on WRT1200AC using OpenWRT Chaos Calmer 15.05.1 here https://forum.openwrt.org/viewtopic.php?pid=332010#p332010



              BEWARE: The example is for WRT1200AC v1 / WRT1900AC v2 / WRT1900ACS v1.



              For WRT1900AC v1 entries for "eth0" and "eth1" need to be SWAPPED.



              See https://wiki.openwrt.org/toh/linksys/wrt1x00ac_series to identify your router model.



              As you noted, getting the config wrong leaves you highly likely to brick your router. So be careful! I made sure SSH login was possible via wireless before proceeding to change LAN port setup.



              From the forum link:



              You can easily brick your router if you don't set the interfaces exactly right, and it's not intuitive. You MUST set WAN port to use "eth0.(vlan_number)" eg: "eth0.100" and the other external ports to use "eth1.(vlan_number)" eg: "eth1.2", even though WAN and LAN ports share the same switch and same VLAN config.



              You must use the "t" tagged flag for the ports which the CPU connects to (5 on eth0 and 6 on eth1). So take careful note of the "5t" and "6t" in my example config below. Advice that is missing the essential "t" beside those entries did not work for me.



              Also for some reason I found WAN had to use a specially set VID of 100 (or any number that isn't 1, and doesn't conflict with your other vlan numbers), while the VLAN itself must still be set to 1. See the example below.



              Lastly, do NOT use Luci to configure the switch (eg: Network > Switch in the Luci inteface). You must edit /etc/config/network by hand to change the switch and VLAN definition. Luci will make a mess of switch and VLAN config. It autodetects the VLANs incorrectly when defining interface physical connections. It will try to call them all "eth0.1, eth0.2, eth0.3.." and so on, when in fact you must use "eth1.X" for all LAN ports and "eth0.X" for the WAN port. Using Luci's Network > Interface > (Interface Name) > Physical Settings config page is fine as long as you ignore the VLANs that Luci autodetects and type the correct ones using the "Custom Interface" box to define them the first time.



              If I failed to do any one of these things, all the ports became unusable. I found that as long as I had SSH access set up to be accessible via the wifi connection, I was able to recover from mistakes easily enough.



              My working config, with WAN and each LAN port on its own VLAN (Ports labelled as 3 and 4 on the back of the device are defined here but currently unassigned to any network):



              /etc/config/network:



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

              #wan port
              config switch_vlan
              option device 'switch0'
              option vlan '1'
              option vid '100'
              option ports '4 5t'

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

              #port 2
              config switch_vlan
              option device 'switch0'
              option vlan '3'
              option vid '3'
              option ports '2 6t'

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

              #port 4
              config switch_vlan
              option device 'switch0'
              option vlan '5'
              option vid '5'
              option ports '0 6t'

              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 ' ( ...whatever your prefix is... ) '

              #Lan on switch port 1
              config interface 'lan'
              option force_link '1'
              option proto 'static'
              option netmask '255.255.255.0'
              option ipaddr '192.168.0.1'
              option ifname 'eth1.2'

              #Another local network on switch port 2
              config interface 'someothernetwork'
              option proto 'static'
              option ifname 'eth1.3'
              option ipaddr '192.168.8.1'
              option netmask '255.255.255.0'

              #WAN on the wan port
              config interface 'wan'
              option ifname 'eth0.100'
              option proto 'dhcp'

              #Wireless
              config interface 'wi'
              option type 'bridge'
              option _orig_ifname 'wlan0 wlan1'
              option _orig_bridge 'true'
              option proto 'static'
              option ipaddr '192.168.6.1'
              option netmask '255.255.255.0'





              share|improve this answer




























                2












                2








                2







                Check out a solution and basic config example to get VLANs working on WRT1200AC using OpenWRT Chaos Calmer 15.05.1 here https://forum.openwrt.org/viewtopic.php?pid=332010#p332010



                BEWARE: The example is for WRT1200AC v1 / WRT1900AC v2 / WRT1900ACS v1.



                For WRT1900AC v1 entries for "eth0" and "eth1" need to be SWAPPED.



                See https://wiki.openwrt.org/toh/linksys/wrt1x00ac_series to identify your router model.



                As you noted, getting the config wrong leaves you highly likely to brick your router. So be careful! I made sure SSH login was possible via wireless before proceeding to change LAN port setup.



                From the forum link:



                You can easily brick your router if you don't set the interfaces exactly right, and it's not intuitive. You MUST set WAN port to use "eth0.(vlan_number)" eg: "eth0.100" and the other external ports to use "eth1.(vlan_number)" eg: "eth1.2", even though WAN and LAN ports share the same switch and same VLAN config.



                You must use the "t" tagged flag for the ports which the CPU connects to (5 on eth0 and 6 on eth1). So take careful note of the "5t" and "6t" in my example config below. Advice that is missing the essential "t" beside those entries did not work for me.



                Also for some reason I found WAN had to use a specially set VID of 100 (or any number that isn't 1, and doesn't conflict with your other vlan numbers), while the VLAN itself must still be set to 1. See the example below.



                Lastly, do NOT use Luci to configure the switch (eg: Network > Switch in the Luci inteface). You must edit /etc/config/network by hand to change the switch and VLAN definition. Luci will make a mess of switch and VLAN config. It autodetects the VLANs incorrectly when defining interface physical connections. It will try to call them all "eth0.1, eth0.2, eth0.3.." and so on, when in fact you must use "eth1.X" for all LAN ports and "eth0.X" for the WAN port. Using Luci's Network > Interface > (Interface Name) > Physical Settings config page is fine as long as you ignore the VLANs that Luci autodetects and type the correct ones using the "Custom Interface" box to define them the first time.



                If I failed to do any one of these things, all the ports became unusable. I found that as long as I had SSH access set up to be accessible via the wifi connection, I was able to recover from mistakes easily enough.



                My working config, with WAN and each LAN port on its own VLAN (Ports labelled as 3 and 4 on the back of the device are defined here but currently unassigned to any network):



                /etc/config/network:



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

                #wan port
                config switch_vlan
                option device 'switch0'
                option vlan '1'
                option vid '100'
                option ports '4 5t'

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

                #port 2
                config switch_vlan
                option device 'switch0'
                option vlan '3'
                option vid '3'
                option ports '2 6t'

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

                #port 4
                config switch_vlan
                option device 'switch0'
                option vlan '5'
                option vid '5'
                option ports '0 6t'

                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 ' ( ...whatever your prefix is... ) '

                #Lan on switch port 1
                config interface 'lan'
                option force_link '1'
                option proto 'static'
                option netmask '255.255.255.0'
                option ipaddr '192.168.0.1'
                option ifname 'eth1.2'

                #Another local network on switch port 2
                config interface 'someothernetwork'
                option proto 'static'
                option ifname 'eth1.3'
                option ipaddr '192.168.8.1'
                option netmask '255.255.255.0'

                #WAN on the wan port
                config interface 'wan'
                option ifname 'eth0.100'
                option proto 'dhcp'

                #Wireless
                config interface 'wi'
                option type 'bridge'
                option _orig_ifname 'wlan0 wlan1'
                option _orig_bridge 'true'
                option proto 'static'
                option ipaddr '192.168.6.1'
                option netmask '255.255.255.0'





                share|improve this answer















                Check out a solution and basic config example to get VLANs working on WRT1200AC using OpenWRT Chaos Calmer 15.05.1 here https://forum.openwrt.org/viewtopic.php?pid=332010#p332010



                BEWARE: The example is for WRT1200AC v1 / WRT1900AC v2 / WRT1900ACS v1.



                For WRT1900AC v1 entries for "eth0" and "eth1" need to be SWAPPED.



                See https://wiki.openwrt.org/toh/linksys/wrt1x00ac_series to identify your router model.



                As you noted, getting the config wrong leaves you highly likely to brick your router. So be careful! I made sure SSH login was possible via wireless before proceeding to change LAN port setup.



                From the forum link:



                You can easily brick your router if you don't set the interfaces exactly right, and it's not intuitive. You MUST set WAN port to use "eth0.(vlan_number)" eg: "eth0.100" and the other external ports to use "eth1.(vlan_number)" eg: "eth1.2", even though WAN and LAN ports share the same switch and same VLAN config.



                You must use the "t" tagged flag for the ports which the CPU connects to (5 on eth0 and 6 on eth1). So take careful note of the "5t" and "6t" in my example config below. Advice that is missing the essential "t" beside those entries did not work for me.



                Also for some reason I found WAN had to use a specially set VID of 100 (or any number that isn't 1, and doesn't conflict with your other vlan numbers), while the VLAN itself must still be set to 1. See the example below.



                Lastly, do NOT use Luci to configure the switch (eg: Network > Switch in the Luci inteface). You must edit /etc/config/network by hand to change the switch and VLAN definition. Luci will make a mess of switch and VLAN config. It autodetects the VLANs incorrectly when defining interface physical connections. It will try to call them all "eth0.1, eth0.2, eth0.3.." and so on, when in fact you must use "eth1.X" for all LAN ports and "eth0.X" for the WAN port. Using Luci's Network > Interface > (Interface Name) > Physical Settings config page is fine as long as you ignore the VLANs that Luci autodetects and type the correct ones using the "Custom Interface" box to define them the first time.



                If I failed to do any one of these things, all the ports became unusable. I found that as long as I had SSH access set up to be accessible via the wifi connection, I was able to recover from mistakes easily enough.



                My working config, with WAN and each LAN port on its own VLAN (Ports labelled as 3 and 4 on the back of the device are defined here but currently unassigned to any network):



                /etc/config/network:



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

                #wan port
                config switch_vlan
                option device 'switch0'
                option vlan '1'
                option vid '100'
                option ports '4 5t'

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

                #port 2
                config switch_vlan
                option device 'switch0'
                option vlan '3'
                option vid '3'
                option ports '2 6t'

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

                #port 4
                config switch_vlan
                option device 'switch0'
                option vlan '5'
                option vid '5'
                option ports '0 6t'

                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 ' ( ...whatever your prefix is... ) '

                #Lan on switch port 1
                config interface 'lan'
                option force_link '1'
                option proto 'static'
                option netmask '255.255.255.0'
                option ipaddr '192.168.0.1'
                option ifname 'eth1.2'

                #Another local network on switch port 2
                config interface 'someothernetwork'
                option proto 'static'
                option ifname 'eth1.3'
                option ipaddr '192.168.8.1'
                option netmask '255.255.255.0'

                #WAN on the wan port
                config interface 'wan'
                option ifname 'eth0.100'
                option proto 'dhcp'

                #Wireless
                config interface 'wi'
                option type 'bridge'
                option _orig_ifname 'wlan0 wlan1'
                option _orig_bridge 'true'
                option proto 'static'
                option ipaddr '192.168.6.1'
                option netmask '255.255.255.0'






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 18 '16 at 8:51

























                answered Jul 18 '16 at 4:50









                AdrianQAdrianQ

                213




                213

























                    0














                    FYI. I applied the same configuration as specified by @AdrianQ on my Linksys 1900AC v2 router running OpenWRT (18.06.02) and it also worked on this device.



                    This makes sense as both the WRT1900AC(v2) and WRT1900ACS routers use the same Marvell 88E6176 ethernet switch and so share the same switch port layout. See device VLAN switch port references:




                    • https://openwrt.org/toh/linksys/linksys_wrt1900ac#switch_ports_for_vlans

                    • https://openwrt.org/toh/linksys/linksys_wrt1900acs#switch_ports_for_vlans






                    share|improve this answer










                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





















                    • What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                      – Scott
                      yesterday











                    • @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                      – Michael
                      yesterday
















                    0














                    FYI. I applied the same configuration as specified by @AdrianQ on my Linksys 1900AC v2 router running OpenWRT (18.06.02) and it also worked on this device.



                    This makes sense as both the WRT1900AC(v2) and WRT1900ACS routers use the same Marvell 88E6176 ethernet switch and so share the same switch port layout. See device VLAN switch port references:




                    • https://openwrt.org/toh/linksys/linksys_wrt1900ac#switch_ports_for_vlans

                    • https://openwrt.org/toh/linksys/linksys_wrt1900acs#switch_ports_for_vlans






                    share|improve this answer










                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





















                    • What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                      – Scott
                      yesterday











                    • @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                      – Michael
                      yesterday














                    0












                    0








                    0







                    FYI. I applied the same configuration as specified by @AdrianQ on my Linksys 1900AC v2 router running OpenWRT (18.06.02) and it also worked on this device.



                    This makes sense as both the WRT1900AC(v2) and WRT1900ACS routers use the same Marvell 88E6176 ethernet switch and so share the same switch port layout. See device VLAN switch port references:




                    • https://openwrt.org/toh/linksys/linksys_wrt1900ac#switch_ports_for_vlans

                    • https://openwrt.org/toh/linksys/linksys_wrt1900acs#switch_ports_for_vlans






                    share|improve this answer










                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.










                    FYI. I applied the same configuration as specified by @AdrianQ on my Linksys 1900AC v2 router running OpenWRT (18.06.02) and it also worked on this device.



                    This makes sense as both the WRT1900AC(v2) and WRT1900ACS routers use the same Marvell 88E6176 ethernet switch and so share the same switch port layout. See device VLAN switch port references:




                    • https://openwrt.org/toh/linksys/linksys_wrt1900ac#switch_ports_for_vlans

                    • https://openwrt.org/toh/linksys/linksys_wrt1900acs#switch_ports_for_vlans







                    share|improve this answer










                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    share|improve this answer



                    share|improve this answer








                    edited yesterday





















                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    answered yesterday









                    MichaelMichael

                    11




                    11




                    New contributor




                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





                    New contributor





                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.













                    • What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                      – Scott
                      yesterday











                    • @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                      – Michael
                      yesterday



















                    • What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                      – Scott
                      yesterday











                    • @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                      – Michael
                      yesterday

















                    What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                    – Scott
                    yesterday





                    What are you saying?   You say you are “looking to implement a similar VLAN configuration”.   So, have you done it?   Did it work?   Did it fail (and are you asking for help)?   Or are you just suggesting something that you think might work, but you haven’t tried?

                    – Scott
                    yesterday













                    @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                    – Michael
                    yesterday





                    @Scott - I confirmed AdrianQ's VLAN configuration also worked on my WRT1900ACv2 and I ammended my post accordingly.

                    – Michael
                    yesterday


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1061327%2fhow-to-setup-vlans-per-interfaces-on-linksys-wrt-1900-acs-openwrt-chaos-calmer%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Список кардиналов, возведённых папой римским Каликстом III

                    Deduzione

                    Mysql.sock missing - “Can't connect to local MySQL server through socket”