Template:Networking rutxxx configuration example use LAN as WAN: Difference between revisions

From Teltonika Networks Wiki
No edit summary
Tags: Mobile edit Mobile web edit
 
(38 intermediate revisions by 3 users not shown)
Line 3: Line 3:
| fw_version = {{{fw_version}}}
| fw_version = {{{fw_version}}}
}}<br>
}}<br>
This article provides a guide on how to configure the LAN ports as WAN. It can be usefull as wired ISP redundant connection or even to change the port for physical damage or a custom mounting.
This article provides a guide on how to configure the LAN ports as WAN. It can be usefull as wired ISP redundant connection or even to change the port for physical damage or a custom mounting.
==Configuration overview and prerequisites==
==Configuration overview and prerequisites==
Before we begin, let's overview the configuration that we are attempting to achieve and the prerequisites that make it possible.
Before we begin, let's overview the configuration that we are attempting to achieve and the prerequisites that make it possible.
'''Prerequisites''':
'''Prerequisites''':
* One RUTxxx series router (excluding [[RUT850]]).
* One RUTxxx series router (excluding [[RUT850]]).
* At least two wired Internet connections.
* At least two wired Internet connections.
* An end device for test the configuration.
* An end device for test the configuration.<br>
<br>
'''Configuration scheme:'''
'''Configuration scheme:'''
[[File:{{{file_scheme}}}|border|class=tlt-border]]


[[File:WAN TO LANSchem3.jpg|border|class=tlt-border]]
==WebUI Router configuration==
Connect to the router’s WebUI navigate to '''Network -> VLAN -> LAN Network''' and create a new interface by entering name and clicking '''Add New'''.<br>
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_1_v3.png|border|class=tlt-border]]<br>
After you clicked '''Add New''' new configuration window will pop-up, there you leave as default and press '''Save.'''
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_2_v1.png|border|class=tlt-border]]<br>
After saving settings, you will be redirected back to '''Network -> VLAN -> VLAN Networks''', now you need to open VLAN Network tab in the same window and you will need to:
<ul>
<li>Select VLAN mode: Port based</li>
<li>Current LAN interface:<br>
- Enable wireless access<br>
- Select your current LAN interface.<br>
- Turn off LAN port 3 <i>(which will be used as WAN port)</i><br>
- Press '''Save'''.</li>
<i> '''Note: Make sure that you are not connected to that LAN port which you going to disable.'''</i>
<li>New LAN_WAN interface:<br>
- Click '''Add''' and a new row will appear.<br>
- Turn off LAN ports 1-2 and leave only LAN port 3 on.<br>
- Select your newly created interface in the LAN section and click '''Save'''.</li>
</ul>
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_3_v1.png|border|class=tlt-border]]
==CLI/SSH Router configuration==
 
The next step of the configuration will be done over SSH/CLI. For this example we'll be using "PuTTY" - a free SSH client that can run on Windows.


==WebUI Router configuration==
Open "PuTTY", enter the router's LAN IP address into the "Host Name (or IP Address)" field and click 'Open'.
Connect to the router’s WebUI navigate to '''Network -> VLAN -> LAN Network''' and create a new interface by entering name and clicking '''“Add New”'''.
 
[[File:LAN TO WAN02.jpg|border|class=tlt-border]]
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_8_v1.png]]
 
Next, enter the login credentials:
 
login as: <b>root</b>
[email protected]'s password: <b><admin_password></b>
 
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_9_v1.png]]
 
Next, we'll have to edit the <b><i>network</i></b> config file using the built-in "vi" text editor. To begin editing the <i>network</i> config file:
 
vi /etc/config/network


<ul>
Then hit the "I" key on your keyboard to enable editing.
After you clicked '''“Add New”''' new configuration window will pop-up, there you leave as default and press '''“Save”.'''
[[File:LAN to WAN04.jpg|border|class=tlt-border|600px]]


<li>'''Note:''' If you want to use a Static IP, see the instructions below.</li>
There are two distinct configurations described below. One is a [[#Static_IP|static IP]] configuration for setting the new WAN port manually, the other is [[#DHCP|DHCP]] - for automatic network configuration of the new WAN port. Follow only the instruction that suits your needs.


'''Static IP need to be set as router’s WAN IP.<br>'''
===DHCP===
Static IP should be in the same subnet as gateway’s LAN interface. For example: if gateway’s LAN subnet is 192.168.10.1, then router’s WAN IP could be for example '''192.168.10.125'''</div>
----
[[File:LAN TO WAN03.jpg|border|class=tlt-border]]
Using the arrow keys on your keyboard, navigate and find <i>config interface 'lan_wan'</i> erase the current configuration and write these options:  
</ul>


After saving settings, you will be redirected back to '''Network -> VLAN -> LAN Network''', now you need to open VLAN Network tab in the same window and you will need to:
option proto 'dhcp'
<li>1. Select VLAN mode: Port based</li>
option ifname 'eth0.1'
<li>2. Currently LAN interface:</li>
option backup '1'
- Enable wireless access<br>
option metric '10'
- Select your currently LAN interface.<br>
- Turn off LAN port 3 '''(which will be used as WAN port)'''<br>
- Press “Save”.
<div style="color: red;"> '''Note: Make sure that you are not connected to that LAN port which you going to disable.'''</div>
<li>3. New LAN_WAN interface:</li>
- Click '''“Add”''' and new row will appear.<br>
- Turn off LAN ports 1-2 and leave only LAN port 3 on.<br>
- Select “lan_wan” in the LAN section and press '''“Save”'''.
[[File:LAN TO WAN05.jpg|border|class=tlt-border|600px]]


==CLI/SSH Router configuration==
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_4_v1.png]]
For the next part you will be configuring router via SSH. For this you need to use the command line interface (CLI) or a SSH software if you’re using Windows or iOS. In this example software '''“putty”''' will be used. Open “putty” enter routers LAN IP address and press '''“Open”'''.<br>
[[File:LAN TO WAN06.jpg|border|class=tlt-border|400px]]


After clicking '''“Open”''' you will need to enter router credentials.
===Static IP===
<li>Login as: '''root'''</li>
----
<li>Password: routers admin password (by default admin01)</li>
Using arrows navigate and find <i>config interface 'lan_wan'</i> leave the current configuration and add these four options:
[[File:LAN TO WAN07.jpg|border|class=tlt-border|400px]]<br>


Now when you are connected you will need to make changes to network settings, this will be
option gateway '192.168.10.1'
achieved via SSH command: '''vi''', which allows you to edit settings in the router. Enter following
option dns '8.8.8.8'
command in SSH:
option backup '1'
option metric '10'


<li>vi /etc/config/network press latter “i” to be able to edit.</li>
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_5_v1.png]]
----
To exit the "vi" editor, press the "Esc" key, type in <i>:wq</i> and hit "Enter". While still on the command line, restart the <i>network</i> service on the router - this will apply the changes made to the configuration. Use this command:


Using arrows navigate and find '''config interface 'lan_wan'''' and add two options:
/etc/init.d/network restart
<li>1. option gateway ‘192.168.10.1’</li>
<li>2. option dns ‘8.8.8.8’</li>
[[File:LAN TO WAN08.jpg|border|class=tlt-border|400px]]<br>


Press '''Esc''' and write ''':wq”'''.
Next go back to the WebUI and navigate to <i>Network → Firewall → <b>General Settings</b></i> page. Scroll down to the "Zone Forwarding" section to find source zone 'lan_wan' and change the following:
After that you will need to restart network service on the router, for this use command:
<li>'''/etc/init.d/network restart'''</li><br>
[[File:LAN TO WAN09.jpg|border|class=tlt-border|400px]]<br>


After restart is completed go back to routers WebUI and navigate to '''Network -> Firewall -> General Settings'''.
<ul>
    <li><b>Default forwarding action</b>: accept</li>
    <li><b>Masquerading</b>: on</li>
    <li><b>Save</b> changes</li>
</ul>


Scroll down, in '''Zone Forwarding''' find source zone '''lan_wan''' and change “Default forwarding action” from '''reject''' to '''accept''' and also check '''Masquerading''' and save settings.<br>
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_6_v1.png|border|class=tlt-border]]
[[File:LAN TO WAN10.jpg|border|class=tlt-border|400px]]<br>


If you did the steps in the right way, the your end device should have internet connection according the scheme.<br>
[[File:LAN TO WAN00.jpg|border|class=tlt-border]]
==Setting a Static WAN IP==
==Testing the configuration==
==Testing the configuration==
If you did the steps in the right way, your end device should have internet connection according the scheme.<br>
Go to '''Network --> WAN''' and check if the new LAN_WAN is enable and if it has an assigned IP.
<li>Set up your WAN as a main connection</li>
<li>Set up your configured LAN port as WAN failover backup.</li>
[[File:Networking_rutxxx_configuration_examples_use_lan_as_wan_7_v1.png|border|class=tlt-border]]<br>
<li>Go to '''www.whatsmyip.com''' and check your public IP.</li>
[[File:0011.png|border|class=tlt-border|960px]]
<li>After that, unplug the WAN cable and check again your Public IP. Your end device should have internet connection and a differt public IP</li>
[[File:0012.png|border|class=tlt-border|960px]]<br>
<li>So, plug again the WAN internet connection and wait a few seconds. The public IP should change again to the first IP shown.</li>
[[Category:{{{name}}} Configuration Examples]]
[[Category:{{{name}}} Configuration Examples]]

Latest revision as of 13:19, 1 October 2021

Introduction

The information in this page is updated in accordance with the [[Media:{{{fw_version}}}_WEBUI.bin|{{{fw_version}}}]] firmware version.
This article provides a guide on how to configure the LAN ports as WAN. It can be usefull as wired ISP redundant connection or even to change the port for physical damage or a custom mounting.

Configuration overview and prerequisites

Before we begin, let's overview the configuration that we are attempting to achieve and the prerequisites that make it possible. Prerequisites:

  • One RUTxxx series router (excluding RUT850).
  • At least two wired Internet connections.
  • An end device for test the configuration.

Configuration scheme: [[File:{{{file_scheme}}}|border|class=tlt-border]]

WebUI Router configuration

Connect to the router’s WebUI navigate to Network -> VLAN -> LAN Network and create a new interface by entering name and clicking Add New.

After you clicked Add New new configuration window will pop-up, there you leave as default and press Save.
After saving settings, you will be redirected back to Network -> VLAN -> VLAN Networks, now you need to open VLAN Network tab in the same window and you will need to:

  • Select VLAN mode: Port based
  • Current LAN interface:
    - Enable wireless access
    - Select your current LAN interface.
    - Turn off LAN port 3 (which will be used as WAN port)
    - Press Save.
  • Note: Make sure that you are not connected to that LAN port which you going to disable.
  • New LAN_WAN interface:
    - Click Add and a new row will appear.
    - Turn off LAN ports 1-2 and leave only LAN port 3 on.
    - Select your newly created interface in the LAN section and click Save.

CLI/SSH Router configuration

The next step of the configuration will be done over SSH/CLI. For this example we'll be using "PuTTY" - a free SSH client that can run on Windows.

Open "PuTTY", enter the router's LAN IP address into the "Host Name (or IP Address)" field and click 'Open'.

Next, enter the login credentials:

login as: root
[email protected]'s password: <admin_password>

Next, we'll have to edit the network config file using the built-in "vi" text editor. To begin editing the network config file:

vi /etc/config/network

Then hit the "I" key on your keyboard to enable editing.

There are two distinct configurations described below. One is a static IP configuration for setting the new WAN port manually, the other is DHCP - for automatic network configuration of the new WAN port. Follow only the instruction that suits your needs.

DHCP


Using the arrow keys on your keyboard, navigate and find config interface 'lan_wan' erase the current configuration and write these options:

option proto 'dhcp'
option ifname 'eth0.1'
option backup '1'
option metric '10'

Static IP


Using arrows navigate and find config interface 'lan_wan' leave the current configuration and add these four options:

option gateway '192.168.10.1'
option dns '8.8.8.8'
option backup '1'
option metric '10'


To exit the "vi" editor, press the "Esc" key, type in :wq and hit "Enter". While still on the command line, restart the network service on the router - this will apply the changes made to the configuration. Use this command:

/etc/init.d/network restart

Next go back to the WebUI and navigate to Network → Firewall → General Settings page. Scroll down to the "Zone Forwarding" section to find source zone 'lan_wan' and change the following:

  • Default forwarding action: accept
  • Masquerading: on
  • Save changes

Testing the configuration

If you did the steps in the right way, your end device should have internet connection according the scheme.
Go to Network --> WAN and check if the new LAN_WAN is enable and if it has an assigned IP.

  • Set up your WAN as a main connection
  • Set up your configured LAN port as WAN failover backup.

  • Go to www.whatsmyip.com and check your public IP.
  • After that, unplug the WAN cable and check again your Public IP. Your end device should have internet connection and a differt public IP

  • So, plug again the WAN internet connection and wait a few seconds. The public IP should change again to the first IP shown.
  • [[Category:{{{name}}} Configuration Examples]]