FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
747 views 4 comments
by anonymous
I am just configuring my new RUTX10. In the LAN section I see one LAN Interface pre-created. Does this cover the several physical ports? I assume so as I have two physical ports working.

What I am trying to do is to find the way to address the individual physical ports. So IN A SCRIPT I need to test the status of my WAN connection using a specific port on  ICMP / ping on using -I (e.g. on eth1 or wan2 or whatever), and then I am going to enable/disable specific LAN ports based on that WAN status using ifup and ifdown commands.
 

How do I find the interface or port names of the physical ports?

1 Answer

0 votes
by anonymous

Hello,

    

To physically disable the LAN ports on RUTX devices, a command like this will need to be used:

swconfig dev switch0 port <port_number> set enable <0 - disabled; 1 - enabled>

At least on RUTX11, actual eth ports start from port 1, as port 0 is reserved for the CPU. Do not disable it!

On the software side, all LAN ports are bridged under the eth0 name, and the WAN port is represented by the eth1 name. What swconfig does, is it disables/enables these ports on the hardware side. So ifup/ifdown command will not work on the LAN ports.

Another way would be to create a separate VLAN and interface for each port and enable/disable it this way. VLAN configuration can be found by navigating to Network → VLAN → Port based. Here, you can create a separate VLAN for each port like this:

And then create a different LAN interface for each of the VLANs by navigating to Network → Interfaces → General. In the physical settings of an interface, select eth0.x, where x represents the VLAN ID (the original LAN interface should remain on eth0).

Hope this answers your question!

  

Best regards,
DaumantasG

Best answer
by anonymous

Hi, DaumantasG.

Thanks for the fast and comprehensive answer.

However on this model I get the response 'Unknown attribute "enable"'. I have the same issue if I try 'enabled', 'disable', 'disabled'.

I tried:

swconfig dev switch0 port 4 show

which gives:
Port 4:
        mib: Port 4 MIB counters
<snip (a load of SNMP stats)/>
        pvid: 1
        link: port:4 link:up speed:1000baseT full-duplex txflow rxflow auto
and 
swconfig dev switch0 port 4 help
gives
switch0: 90000.mdio(QCA AR40xx), ports: 6 (cpu @ 0), vlans: 128
     --switch
        Attribute 1 (int): soft_reset (Switch soft reset with delay (seconds))
        Attribute 2 (int): enable_vlan (Enable VLAN mode)
        Attribute 3 (none): reset_mibs (Reset all MIB counters)
        Attribute 4 (int): enable_mirror_rx (Enable mirroring of RX packets)
        Attribute 5 (int): enable_mirror_tx (Enable mirroring of TX packets)
        Attribute 6 (int): mirror_monitor_port (Mirror monitor port)
        Attribute 7 (int): mirror_source_port (Mirror source port)
        Attribute 8 (none): flush_arl (Flush ARL table)
        Attribute 9 (string): dump_arl (Dump ARL table with mac and port map)
        Attribute 10 (int): linkdown (Link down all the PHYs)
        Attribute 11 (int): preference (Set fiber/copper combo preference)
        Attribute 12 (none): apply (Activate changes in the hardware)
        Attribute 13 (none): reset (Reset the switch)
     --vlan
        Attribute 1 (int): vid (VLAN ID (0-4094))
        Attribute 2 (ports): ports (VLAN port mapping)
     --port
        Attribute 1 (none): reset_mib (Reset single port MIB counters)
        Attribute 2 (string): mib (Get port's MIB counters)
        Attribute 3 (int): pvid (Primary VLAN ID)
        Attribute 4 (unknown): link (Get port link information)
Any suggestions, please?
by anonymous
I just updated my firmware.

One weird effect was that the ports got renumbered!

But I think that DaumantasG's solution will prove to be correct, as now I have the 'enable' attribute available.

Will update.
by anonymous
Many thanks.

The firmware update gave me a modified set of attributes and I can now enable/disable a physical port at will e.g.

swconfig dev switch0 port 3 set enable 0

disables LAN port 3.
by anonymous
Glad I could help!

Let me know if any more information is needed.

  

Best regards,
DaumantasG