Difference between revisions of "RUTX12 Traffic control with Firewall WANzone Splitting"

From Teltonika Networks Wiki
(56 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<p style="color:red">The information in this page is updated in accordance with [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.08'''] firmware version.</p>
+
 
 
==Introduction==
 
==Introduction==
 
This article contains instructions on how to configure mobile SIM traffic effectively, The configuration ensures that when SIM1 is active, it provides internet connectivity to all end devices. However, when SIM2 is being used, the configuration should impose restrictions on the traffic flow from PC2 and only traffic from.
 
This article contains instructions on how to configure mobile SIM traffic effectively, The configuration ensures that when SIM1 is active, it provides internet connectivity to all end devices. However, when SIM2 is being used, the configuration should impose restrictions on the traffic flow from PC2 and only traffic from.
[[File:Topology..png|border|center|class=tlt-border]]
+
[[File:Image Traffic Control..png|center|700x700px|Image Traffic Control|alt=]]
 
==Prerequisites==
 
==Prerequisites==
 
For this configuration you will need:
 
For this configuration you will need:
  
* Teltonika Networks router with dual sim card support (RUTX12 is being used in the example);
+
* Teltonika Networks router with dual sim card support (RUTX11 is being used in the example);
 
* 2 SIM cards;
 
* 2 SIM cards;
 
* 2 end devices connected to the router (PC's are being used in the example);
 
* 2 end devices connected to the router (PC's are being used in the example);
Line 12: Line 12:
 
==Preparation==
 
==Preparation==
  
* Prepare RUTX12, power up the device, insert two sim cards, check that both are active and working. SIM1, SIM2, PWR, and signal strength indicators should light up.
+
* Prepare RUTX12, power up the device, insert two sim cards, check that both are active and working. SIM1, SIM2, PWR and signal strength indicators should light up.
* Access the router through WEBUI, go to <b>Network -> Interfaces</b>, and make sure that one or the other mobile interference is running MOB1S1A1 or MOB2S1A1 (Status = Running). You should be able to see the IP address assigned to it. In addition, it is recommended to perform connectivity checking by using the ping utility.
+
* Access the router through WEBUI, go to Network -> Interfaces, make sure that one or the other mobile interference is running MOB1S1A1 or MOB2S1A1 (Status = Running). You should be able to see their Ip addresses.
 
* Make sure that you have ADVANCED mode enabled. This will allow you to choose from a larger variety of settings.
 
* Make sure that you have ADVANCED mode enabled. This will allow you to choose from a larger variety of settings.
 +
 +
== Firewall ==
 +
A '''Firewall''' is a network security software that is designed to monitor, filter, and control incoming and outgoing network traffic based on predetermined security rules. Its primary purpose is to establish a barrier between a trusted internal network and untrusted external networks, such as the internet. Firewalls play a crucial role in enhancing the security of computer networks by regulating the flow of data and protecting against unauthorized access, cyberattacks, and data breaches.
  
 
== Configuration ==
 
== Configuration ==
{{Template:Networking_rutos_manual_basic_advanced_webui_disclaimer
+
 
| series = RUTX
 
}}
 
 
=== Firewall General Settings ===
 
=== Firewall General Settings ===
The '''General Settings''' section is utilized for configuring the core policies of the device's firewall. To access this configuration, proceed to: '''Network –> Firewall -> General Setting''' While maintaining the default settings for other options, click on the Edit symbol corresponding to the zones.<br>
+
The '''General Settings''' section is utilized for configuring the core policies of the device's firewall. The visual representation depicted below presents an illustrative model of the General Settings section. The ensuing table provides comprehensive information about the fields that are intended to be configured within this section.  To access this configuration, proceed to: '''Network –> Firewall -> General Setting''' While maintaining the default settings for other options, click on the Edit symbol corresponding to the zones.   
The '''Zones''' section is employed to oversee the default traffic forwarding policies among distinct zones within the deviceBoth "'''mob1s1a1'''" and "'''mob2s1a1'''" by default are situated within the same Firewall zone, signifying that identical rules are applied to both mobile interfaces/SIM cards. Consequently, any traffic restriction in this zone will simultaneously influence both SIM cards. As a result, it becomes necessary to create two distinct zones for each SIM individually.
 
  
==== Editing existing firewall zone ====
+
[[File:Firewall_General_setting.png|alt=|700x700px]]
  
# Go to '''Network→ Firewall→ General→ Zones'''
 
# Locate the WAN zone and click on the '''edit button''' (pencil sign)
 
  
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_1.png|border|center|class=tlt-border|1100px]]
 
  
# Remove the '''mob2s1a1''' interface from the Default Firewall zone configuration
+
The '''Zones''' section is employed to oversee the default traffic forwarding policies among distinct zones within the device.  Both "'''mob1s1a1'''" and "'''mob2s1a1'''" will be situated within the same Firewall zone, signifying that identical rules are pertinent to both SIM cards. Consequently, any traffic rule established will simultaneously influence on both SIM cards. As a result, it becomes necessary to generate two distinct zones for each SIM individually.
# Save the settings by clicking '''Save & Apply''' button at the bottom right hand side
 
  
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_2.png|border|center|class=tlt-border]]
+
[[File:Zone.png|alt=|600x600px]]
==== Create a new Zone: ====
 
----To create a new zone, simply click on the "Add" button located in the bottom right corner.
 
  
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_3.png|border|center|class=tlt-border|1100px]]
+
=== Create a new Zone: ===
By clicking on '''Add''' button as shown:
+
[[File:Zone_Settings.png|alt=|600x600px]]<br />
# Choose a '''Name''' for this rule as per your preference.
 
# Set the input to be in the "'''Reject'''" zone.
 
# Designate the output to be in the "'''Accept'''" zone.
 
# Configure the forward action to be directed to the "'''Reject'''" zone.
 
# Activate both '''Masquerading''' and '''MSS clamping''' options.
 
# In the "'''Covered'''" zone, select the SIM Interface individually. In the provided example, it will be "SIM2" identified as "mob2s1a1".
 
# In the inter-zone section keep Allow forward from source zones as "'''lan'''"
 
# Click on '''"Save & Apply"''' in the bottom right corner.
 
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_4.png|border|center|class=tlt-border]]
 
<br />Once you have created the new zone, it should resemble the following:
 
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_5.png|border|center|class=tlt-border|1100px]]
 
  
=== Traffic rule creation ===
+
By clicking on '''Add''' button as shown:
----
 
To establish the traffic rule according to the zones you've set up, follow these steps  '''Navigate to Network –> Firewall -> Traffic Rules''' to begin creating the rule.  Create and set up the rule to enable the host's access to the web server. 
 
  
* In the '''<nowiki/>'''Add type field, select '''<nowiki/>'Add new forward rule''''.
+
* Choose a '''Name''' for this rule as per your preference.
* Assign a Name of your choosing to this rule.
+
* Set the input to be in the "'''Reject'''" zone. 
 +
* Configure the forward action to be directed to the "'''Reject'''" zone. 
 +
* Designate the output to be in the "'''Accept'''" zone. 
 +
* Activate both '''Masquerading''' and '''MSS clamping''' options. 
 +
* In the "'''Covered'''" zone, select the SIM Interface individually. In the provided example, it will be "SIM2" identified as "mob2s1a1".
 +
 
 +
[[File:New Zone.png|700x700px]]
 +
 
 +
=== Establish the traffic rule ===
 +
To establish the traffic rule according to the zones you've set up, follow these steps  '''Navigate to Network –> Firewall -> Traffic Rule''' to begin creating the rule.  Create and set up the rule to enable the host's access to the web server. 
 +
 
 +
* In the '''<nowiki/>'Add type'''' field, select 'Add new forward rule'.
 +
* Assign a '''Name''' of your choosing to this rule.
 
* Choose "'''LAN'''" as the source zone.   
 
* Choose "'''LAN'''" as the source zone.   
* Select "'''WAN2'''" as the destination zone.
+
* Select "'''WAN'''" as the destination zone.
* Click the ''''Add'''<nowiki/>' button to confirm and add the rule.
+
* Click the 'Add' button to confirm and add the rule.
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_6.png|border|center|class=tlt-border|1100px]]
+
 
 +
[[File:Add New Instance.png]]
  
 
=== Specify the source zone ===
 
=== Specify the source zone ===
 
Upon clicking '''<nowiki/>'Add'''' in the previous step, a new window will appear, enabling you to define additional configurations.   
 
Upon clicking '''<nowiki/>'Add'''' in the previous step, a new window will appear, enabling you to define additional configurations.   
  
# '''Enable the instance''';
+
* Specify the source zone for which the SIM Interface is intended. In the provided instance, this would be '''SIM2''' labelled as "'''mob2s1a1'''". 
# Choose Protocol: '''All''';
+
* Choose the '''MAC address''' associated with the host to which the rule is to be applied in the source MAC address section. If needed, you can input a custom MAC address.
# Choose the Source IP address '''the one to block, e.g. 192.168.11.228 in this case''';
+
* Input the '''IP address''' of the host in the source IP address field. 
# Choose Action: '''Reject''';
+
* Within the action field, opt for '''<nowiki/>'Accept''''
 
* Click on '''<nowiki/>'Save and Apply''''.
 
* Click on '''<nowiki/>'Save and Apply''''.
[[File:RutOS_traffic_control_firewall_wanzone_split_7.8_7.png|border|center|class=tlt-border]]
 
 
== Testing the configuration ==
 
If you have followed all the provided steps to test the firewall traffic rules and verify the configuration, here is the revised description:
 
 
# Initially, ensure that your router's WAN is connected to SIM1.
 
# From PC1, access the web UI and navigate to "Service" -> "CLI."
 
# Log in using the username "root" and the router's admin password.
 
# In the CLI, ping the IP address 8.8.8.8. If you receive a response, it confirms that internet connectivity is established through SIM1 mobile connectivity on PC1.
 
# Perform the same procedure on PC2 by logging into the CLI and pinging the IP address 8.8.8.8. If you receive a response, it also confirms that internet connectivity is established via SIM1 on PC2.
 
  
Next, switch the router's WAN connection to SIM2 and conduct the following tests:
+
[[File:Traffic Rules.png]]
  
# Ping 8.8.8.8 from PC1. After logging into the CLI and pinging the IP address 8.8.8.8 If you receive a response, it indicates that SIM2 has internet connectivity.
 
# Ping 8.8.8.8 from PC2. when pinging the IP address 8.8.8.8 from PC2 and If you experience 100% packet loss, it means that PC2 does not have internet connectivity via SIM2.
 
  
These tests serve to validate the functionality of the firewall rules and the connectivity of the router's WAN connections.
 
[[File:Testing Traffic rules.png|border|center|class=tlt-border]]
 
 
You can specify additional settings as you wish. For example, you can set times when this rule should apply. This way, the host will be able to access the web server only at certain times.
 
You can specify additional settings as you wish. For example, you can set times when this rule should apply. This way, the host will be able to access the web server only at certain times.

Revision as of 08:41, 12 September 2023

Introduction

This article contains instructions on how to configure mobile SIM traffic effectively, The configuration ensures that when SIM1 is active, it provides internet connectivity to all end devices. However, when SIM2 is being used, the configuration should impose restrictions on the traffic flow from PC2 and only traffic from.

Prerequisites

For this configuration you will need:

  • Teltonika Networks router with dual sim card support (RUTX11 is being used in the example);
  • 2 SIM cards;
  • 2 end devices connected to the router (PC's are being used in the example);

Preparation

  • Prepare RUTX12, power up the device, insert two sim cards, check that both are active and working. SIM1, SIM2, PWR and signal strength indicators should light up.
  • Access the router through WEBUI, go to Network -> Interfaces, make sure that one or the other mobile interference is running MOB1S1A1 or MOB2S1A1 (Status = Running). You should be able to see their Ip addresses.
  • Make sure that you have ADVANCED mode enabled. This will allow you to choose from a larger variety of settings.

Firewall

A Firewall is a network security software that is designed to monitor, filter, and control incoming and outgoing network traffic based on predetermined security rules. Its primary purpose is to establish a barrier between a trusted internal network and untrusted external networks, such as the internet. Firewalls play a crucial role in enhancing the security of computer networks by regulating the flow of data and protecting against unauthorized access, cyberattacks, and data breaches.

Configuration

Firewall General Settings

The General Settings section is utilized for configuring the core policies of the device's firewall. The visual representation depicted below presents an illustrative model of the General Settings section. The ensuing table provides comprehensive information about the fields that are intended to be configured within this section. To access this configuration, proceed to: Network –> Firewall -> General Setting While maintaining the default settings for other options, click on the Edit symbol corresponding to the zones.


The Zones section is employed to oversee the default traffic forwarding policies among distinct zones within the device. Both "mob1s1a1" and "mob2s1a1" will be situated within the same Firewall zone, signifying that identical rules are pertinent to both SIM cards. Consequently, any traffic rule established will simultaneously influence on both SIM cards. As a result, it becomes necessary to generate two distinct zones for each SIM individually.

Create a new Zone:


By clicking on Add button as shown:

  • Choose a Name for this rule as per your preference.
  • Set the input to be in the "Reject" zone.
  • Configure the forward action to be directed to the "Reject" zone.
  • Designate the output to be in the "Accept" zone.
  • Activate both Masquerading and MSS clamping options.
  • In the "Covered" zone, select the SIM Interface individually. In the provided example, it will be "SIM2" identified as "mob2s1a1".

New Zone.png

Establish the traffic rule

To establish the traffic rule according to the zones you've set up, follow these steps Navigate to Network –> Firewall -> Traffic Rule to begin creating the rule. Create and set up the rule to enable the host's access to the web server.

  • In the 'Add type' field, select 'Add new forward rule'.
  • Assign a Name of your choosing to this rule.
  • Choose "LAN" as the source zone.
  • Select "WAN" as the destination zone.
  • Click the 'Add' button to confirm and add the rule.

Add New Instance.png

Specify the source zone

Upon clicking 'Add' in the previous step, a new window will appear, enabling you to define additional configurations.

  • Specify the source zone for which the SIM Interface is intended. In the provided instance, this would be SIM2 labelled as "mob2s1a1".
  • Choose the MAC address associated with the host to which the rule is to be applied in the source MAC address section. If needed, you can input a custom MAC address.
  • Input the IP address of the host in the source IP address field.
  • Within the action field, opt for 'Accept'.
  • Click on 'Save and Apply'.

Traffic Rules.png


You can specify additional settings as you wish. For example, you can set times when this rule should apply. This way, the host will be able to access the web server only at certain times.