1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Vlans on Merlin (mini howto)

Discussion in 'Asuswrt-Merlin' started by c0mm0n, Nov 5, 2014.

  1. c0mm0n

    c0mm0n New Around Here

    Joined:
    Oct 31, 2014
    Messages:
    9
    Hi,

    I've discovering merlin, robocfg, etc... and needed to do something which is usually trivial : tag a VLAN on a given port, or LAN, etc...

    I think I got it and wanted to share as it seems it's a frequent question.

    You must have your ways in SSH, etc I don't go into the detail,s just giving you the big picture.

    With default settings on AC66U Merlin firmware , a "robocfg show" would give me
    Code:
       1: vlan1: 1 2 8t
       2: vlan2: 0 8u
    1 2 = LAN ports 1/2
    0 = WAN port
    8 refers to router's internal interface, I'm not sure about the t and u so won't elaborate.

    Let's say I would like to TAG the VLAN 835 on port 2

    I would :
    Code:
    robocfg vlan 835 ports "2t 8t"
    Which means (for me) : create vlan 835 and have it TAGGUED (t) on port 2.

    If I want it on port 1 and 2 you can
    Code:
    robocfg vlan 835 ports "1t 2t 8t"
    Tagging it on the wan would have you use "0t" etc...

    Robocfg is the switch configuration utility So from there If you want IFs, IP adresses, etc... you still have to use vconfig for that afterwards.

    These 2 links were useful and may give you hints at more commands with vconfig, etc...
    English : http://zwizwa.be/-/openwrt/20110302-002431
    Another one in French but commands still useful
    http://www.neufbox4.org/wiki/index.php?title=Configurer_les_VLANs

    Hope it helps, please report If I misinterpreted something.
     
  2. AndreyPopov

    AndreyPopov Senior Member

    Joined:
    Jun 28, 2014
    Messages:
    287
    Location:
    Ukraine
    this is specific formula only for AC66U

    other routers have different switch formula!

    8 - is CPU

    http://forums.smallnetbuilder.com/showpost.php?p=131762&postcount=6
     
    Last edited: Nov 5, 2014
  3. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,858
    Location:
    Canada
    T means Tagged, U for Untagged.
     
  4. Kiwirouter

    Kiwirouter New Around Here

    Joined:
    Sep 16, 2015
    Messages:
    3
    I know this is an old topic but im trying to tag vlan 10 on the WAN port as the fibre company im with requires it... ive managed to change it with the following command

    Code:
    robocfg switch enable port 0 state enabled stp none tag 10 jumbo off vlan 10 ports "0t 8t"
    that then produces this when i run robocfg show

    Code:
    VLANs: BCM53115 enabled mac_check mac_hash
        1: vlan1: 1 2 3 4 8t
        2: vlan2: 0 8u
        3: vlan10: 0t 8t 
    
    and i can see under tools that the vlan on the WAN port is now 10.. however when i reboot the router it goes back to VLAN2. How do i permanently change this?? and do i need to remove vlan2 somehow?
     
  5. VANT

    VANT Very Senior Member

    Joined:
    Feb 4, 2015
    Messages:
    814
    Location:
    Poland
    My dream would be to see this solution in fw as gui... :)
     
  6. maurer

    maurer Regular Contributor

    Joined:
    May 13, 2014
    Messages:
    111
    then try tomato :) it's already there
     
  7. VANT

    VANT Very Senior Member

    Joined:
    Feb 4, 2015
    Messages:
    814
    Location:
    Poland
    where i can find tomato for 87u ?
     
  8. Theliel

    Theliel Occasional Visitor

    Joined:
    Apr 7, 2014
    Messages:
    45
    If you only need vlan for internet, you should try in-gui options:

    LAN -> IPTV . In your case, try with:

    Internet: VID 10, PRIO 1

    should work fine.

    Anyway you can allways use a script.

    Create a file called wan-start

    #!/bin/sh
    YOUR_CODE

    copy the file to /jffs/scripts and enable on GUI JFFS custom scripts and configs
     
  9. Kiwirouter

    Kiwirouter New Around Here

    Joined:
    Sep 16, 2015
    Messages:
    3
    thanks Theliel but i have solved it using ssh and the nvram command

    Code:
    nvram unset 'vlan2ports'
    nvram unset 'vlan2hwname'
    nvram set 'vlan10ports=0t 8u'
    nvram set 'vlan10hwname=et0'
    nvram commit
    
     
  10. Scott Jacobs

    Scott Jacobs Occasional Visitor

    Joined:
    Sep 16, 2015
    Messages:
    16
    Interesting - I had previously tried (unsuccessfully) to use DD-WRT and some instructions on the wiki site for enabling a multi-wan connection - like you can do via the GUI with Merlin and the base Asus. Unfortunately DD-WRT does not support doing that directly in the GUI. The thing I noticed that is similar between what you did above in your script and what those instructions suggest is that you set the new hwname to 'et0'. I was looking at the nvram configuration with Merlin and when multi-wan is enabled - this is what I have for the hw names:
    vlan1hwname=et1
    vlan2hwname=et1
    vlan3hwname=et1

    The ports are set up as follows (I am using AC-87U - and chose the Lan #4 labeled port for secondary wan - which is actually the port #1 in the nvram vars shown below):
    vlan1ports = "2 3 5 7*"
    vlan3ports = "1 7"
    vlan2ports = "0 7"

    Anyhow - based on my reading of the setup with DD-WRT - I would have expected to see my vlan3hwname to be set to et0 - but as you can see it is set to the same as vlan2 and 1. I really don't understand how this hw name plays into it. And I noticed that you used 'et0' for your solution above. What drives which one to choose here for setting the hwname?
     
  11. Kiwirouter

    Kiwirouter New Around Here

    Joined:
    Sep 16, 2015
    Messages:
    3
    I chose et0 because that's the WAN port and as i say i wanted to change the default vlan2 on the WAN port to vlan10
     
  12. mystical

    mystical Occasional Visitor

    Joined:
    Feb 29, 2016
    Messages:
    27
    Hello,
    I have been trying to understand how to configure my RT-AC66U running Merlin 380.57 so that I can provide internet connections to several apartments in my building, but keep them from accessing each other's LANs. Doing that would seem simple if I could assign LAN ports to separate VLANs and configure the AC68U as a DHCP service to provide addresses 192.168.1.x to LAN1, 192.168.2.x to LAN2,....
    Reconfiguring via an ssh session is easy for me, but I hesitate to start experimenting with my AC66U without understanding the configuration changes after I change the VLAN assignments on the chip using robocfg.

    I am starting with a pretty simple configuration:

    [email protected]:/tmp/home/root# robocfg show
    Switch: enabled gigabit
    Port 0: 100FD enabled stp: none vlan: 2 jumbo: off mac: bc:e6:3f:d6:b7:1b
    Port 1: 100FD enabled stp: none vlan: 3 jumbo: off mac: ec:08:6b:7d:c4:3a
    Port 2: 1000FD enabled stp: none vlan: 1 jumbo: off mac: ba:8d:12:80:67:00
    Port 3: 100FD enabled stp: none vlan: 1 jumbo: off mac: b8:8d:12:54:fc:98
    Port 4: DOWN enabled stp: none vlan: 1 jumbo: off mac: b8:8d:12:54:fc:98
    Port 8: 1000FD enabled stp: none vlan: 1 jumbo: off mac: bc:ee:7b:7a:16:80
    VLANs: BCM53115 enabled mac_check mac_hash
    1: vlan1: 2 3 4 8t
    2: vlan2: 0 8t
    3: vlan3: 1 8t
    [email protected]:/tmp/home/root#

    Thanks for any help or pointers to other threads.
     
  13. CiscoX

    CiscoX Senior Member

    Joined:
    Aug 13, 2013
    Messages:
    205
    Hi,

    Read this one, maybe some good information :)
    http://www.snbforums.com/threads/fo...guest-network-for-asus-merlin-rt-ac68u.18969/
     
    mystical likes this.
  14. mystical

    mystical Occasional Visitor

    Joined:
    Feb 29, 2016
    Messages:
    27
    halex4u and CiscoX like this.
  15. lap316

    lap316 New Around Here

    Joined:
    Nov 10, 2016
    Messages:
    2
    hello i have one question i'm very new with ssh commands

    so when i do my config
    robocfg vlan 835 ports "1t 2t 8t"

    after a reboot i cannot save, so how can i save my command

    thank you
     
  16. Skirk

    Skirk Occasional Visitor

    Joined:
    Jan 26, 2014
    Messages:
    47
    Location:
    New Zealand
    Code:
    nvram commit
     
  17. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    31,858
    Location:
    Canada
    robocfg settings are not written to nvram. Committing nvram won't do anything.

    You have to put the command within a user script. See the Wiki for more info.
     
    Skirk likes this.
  18. Skirk

    Skirk Occasional Visitor

    Joined:
    Jan 26, 2014
    Messages:
    47
    Location:
    New Zealand
    Thanks! I just had a play this weekend and was just about to report back with my failure :)
     
  19. lap316

    lap316 New Around Here

    Joined:
    Nov 10, 2016
    Messages:
    2
    ok thank you for all
     
  20. Cesar8489

    Cesar8489 New Around Here

    Joined:
    Nov 20, 2016
    Messages:
    4
    Hi guys,

    Is there any command to clone my mac-address on port 4?

    My ISP requires VLAN Tagging (200) and MAC ADDRESS cloning.

    So far:
    robocfg switch enable port 4 state enabled stp none tag 200 jumbo off vlan 200 ports "4t 8t"

    Now, I need a specific MAC-Address on port 4.

    Thank you.
    PD: I'm using Merlin 380.63_2 on Asus AC88u. MAC adress cloning through Web UI does not work.