Jump to content

RUTX12 Traffic control with Firewall WANzone Splitting: Difference between revisions

no edit summary
No edit summary
No edit summary
(47 intermediate revisions by 2 users not shown)
Line 2: Line 2:
==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:Image Traffic Control..png|center|700x700px|Image Traffic Control|alt=]]
[[File:Topology..png|border|center|class=tlt-border]]
==Prerequisites==
==Prerequisites==
For this configuration you will need:
For this configuration you will need:
Line 24: Line 24:
The '''Zones''' section is employed to oversee the default traffic forwarding policies among distinct zones within the device.  Both "'''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.  
The '''Zones''' section is employed to oversee the default traffic forwarding policies among distinct zones within the device.  Both "'''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.  


[[File:Firewall_General_setting.png|alt=|700x700px]]
==== Editing existing firewall zone ====


==== Editing existing firewall zone ====
# Go to '''Network→ Firewall→ General→ Zones'''
# Locate the WAN zone and click on the '''edit button''' (pencil sign)


[[File:Zone.png|alt=|600x600px]]
[[File:Firewall_wan_zone_split_1.png|border|center|class=tlt-border]]
[[File:Firewall_wan_zone_split_1.png|border|center|class=tlt-border]]
# Remove the '''mob1s2a1''' interface from the Default Firewall zone configuration
# Save the settings by clicking '''Save & Apply''' button at the bottom right hand side
[[File:Firewall_wan_zone_split_2.png|border|center|class=tlt-border]]
[[File:Firewall_wan_zone_split_2.png|border|center|class=tlt-border]]
==== Create a new Zone: ====
==== Create a new Zone: ====
----
----To create a new zone, simply click on the "Add" button located in the bottom right corner.
[[File:Zone_Settings.png|alt=|600x600px]]<br />
 
By clicking on '''Add''' button as shown:


* Choose a '''Name''' for this rule as per your preference.  
[[File:Firewall_wan_zone_split_3.png|border|center|class=tlt-border]]
* Set the input to be in the "'''Reject'''" zone.
By clicking on '''Add''' button as shown:
* Configure the forward action to be directed to the "'''Reject'''" zone.
# Choose a '''Name''' for this rule as per your preference.
* Designate the output to be in the "'''Accept'''" zone.
# Set the input to be in the "'''Reject'''" zone.
* Activate both '''Masquerading''' and '''MSS clamping''' options.
# Designate the output to be in the "'''Accept'''" zone.
* In the "'''Covered'''" zone, select the SIM Interface individually. In the provided example, it will be "SIM2" identified as "mob2s1a1".
# Configure the forward action to be directed to the "'''Reject'''" zone.
 
# Activate both '''Masquerading''' and '''MSS clamping''' options.
[[File:New Zone.png|700x700px]]
# In the "'''Covered'''" zone, select the SIM Interface individually. In the provided example, it will be "SIM2" identified as "mob1s2a1".
# In the inter-zone section keep Allow forward from source zones as "'''lan'''"
# Click on '''"Save & Apply"''' in the bottom right corner.
[[File:Firewall_wan_zone_split_4.png|border|center|class=tlt-border]]
<br />Once you have created the new zone, it should resemble the following:
[[File:NewZone.png|border|center|class=tlt-border]]


=== Traffic rule creation ===
=== Traffic rule creation ===
Line 50: Line 56:
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.   
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'.
* In the '''<nowiki/>'''Add type field, select '''<nowiki/>'Add new forward rule''''.
* Assign a '''Name''' of your choosing to this rule.
* Assign a Name of your choosing to this rule.
* Choose "'''LAN'''" as the source zone.   
* Choose "'''LAN'''" as the source zone.   
* Select "'''WAN'''" as the destination zone.
* Select "'''WAN2'''" as the destination zone.
* Click the 'Add' button to confirm and add the rule.
* Click the ''''Add'''<nowiki/>' button to confirm and add the rule.
 
[[File:Add new Instance.png|border|center|class=tlt-border]]
[[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.   


* Specify the source zone for which the SIM Interface is intended. In the provided instance, this would be '''SIM2''' labelled as "'''mob2s1a1'''".
* Source zone change to "'''WAN2:mob1s2a1"'''
* Specify the source zone for which the SIM Interface is intended. In the provided instance, this would be '''SIM2''' labelled as "'''mob1s2a1'''".
* 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 '''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.   
* Input the '''IP address''' of the host in the source IP address field.   
* Within the action field, opt for '''<nowiki/>'Accept''''.  
* Within the action field, opt for '''<nowiki/>'Reject''''.
* Click on '''<nowiki/>'Save and Apply''''.
* Click on '''<nowiki/>'Save and Apply''''.
[[File:FirewallTraffic Rule.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.


[[File:Traffic Rules.png]]
Next, switch the router's WAN connection to SIM2 and conduct the following tests:


# 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.