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
284 views 1 comments
by anonymous

How to check which WAN interface is currently used for data transmission?

Best Regards

1 Answer

0 votes
by anonymous

Hello,

There are multiple ways to for that.

In the WebUI, the overview window has added (Main), next to the interface, which is used for WAN connectivity.

You can also go to Network -> Interfaces section, where Main WAN is the highest online interface in the list. 

In the CLI/SSH, you can execute the following command:

  • ifconfig

It will list you all available network interfaces, and based on the Metric value (the lower the value, the higher the priority), or data consumption metrics you can tell the main WAN interface.

In the CLI you can also execute the following command:

  • curl ifconfig.me

Which will return the public IP as seen from WAN side. Combined with the output of the ifconfig command you can match the outbound interface. 

You can also check the routing table, with ip route command to provide with the default interface to reach internet.

Best regards,

by anonymous

To supplement Žygimantas answer - there is also a command to check which route (interface) will be used if we attempt to reach <DESTINATION_IP>. This will not form a packet, but instead it will tell us how our system would route the packet, if it had to reach the desired destination.

We can test this via command line interface, using the following command:

ip route get <DESTINATION_IP>

For example, if we would like to check which interface would be used to attempt reaching [unicast] host 8.8.8.8, I would use the following command:

ip route get 8.8.8.8

The output of this command show be similar to the following:

8.8.8.8 via 10.66.3.1 dev eth1 src 10.66.3.214 uid 0 cache

The output indicates that if our device must route a packet to the destination IP address of 8.8.8.8, the packet will be forwarded to next hop of 10.66.3.1 using interface eth1 [that currently has an IP address of 10.66.3.214].