Skip to main content

Setingan Loadbalance openwrt

 config globals 'globals'

	option enabled '1'
	option mmx_mask '0x3F00'

config interface 'wan'
	option enabled '1'
	list track_ip '8.8.4.4'
	list track_ip '8.8.8.8'
	list track_ip '208.67.222.222'
	list track_ip '208.67.220.220'
	option reliability '2'
	option count '1'
	option timeout '2'
	option interval '5'
	option down '3'
	option up '8'
 
config interface 'wan2'
	option enabled '1'
	list track_ip '8.8.8.8'
	list track_ip '208.67.220.220'
	option reliability '1'
	option count '1'
	option timeout '2'
	option interval '5'
	option down '3'
	option up '8'
 
config member 'wan_m1_w3'
	option interface 'wan'
	option metric '1'
	option weight '3'
 
config member 'wan_m2_w3'
	option interface 'wan'
	option metric '2'
	option weight '3'
 
config member 'wan2_m1_w2'
	option interface 'wan2'
	option metric '1'
	option weight '2'
 
config member 'wan2_m2_w2'
	option interface 'wan2'
	option metric '2'
	option weight '2'
 
config policy 'wan_only'
	list use_member 'wan_m1_w3'
 
config policy 'wan2_only'
	list use_member 'wan2_m1_w2'
 
config policy 'balanced'
	list use_member 'wan_m1_w3'
	list use_member 'wan2_m1_w2'
 
config policy 'wan_wan2'
	list use_member 'wan_m1_w3'
	list use_member 'wan2_m2_w2'
 
config policy 'wan2_wan'
	list use_member 'wan_m2_w3'
	list use_member 'wan2_m1_w2'
 
config rule 'sticky_even'
	option src_ip '0.0.0.0/0.0.0.1'
	option dest_port '443'
	option proto 'tcp'
	option use_policy 'wan_wan2'
 
config rule 'sticky_odd'
	option src_ip '0.0.0.1/0.0.0.1'
	option dest_port '443'
	option proto 'tcp'
	option use_policy 'wan2_wan'
 
config rule 'default_rule'
	option dest_ip '0.0.0.0/0'
	option use_policy 'balanced'


-=================
FULL Teks dari web credit to : https://github.com/tiagonmas/ar-750-use-lan-port-as-2nd-wan.md

OpenWrt - GL.iNet AR-750 Use LAN port as 2nd WAN in order to use Mwan3

Introduction

How to configure the network of a GL-AR750 device, using OpenWRT, in order to use a LAN port as your second WAN, so that afterwards you can configure Mwan3 to load balance Wan connections.

Table Of Contents

Network configuration file

  • Start by connecting to the machine via ssh.

  • Before changing the file I suggest you create a copy of your original network configuration

root@GL-AR750:~# cp /etc/config/network /etc/config/network.bak

The changes to make

Edit the network configuration file in your favorite editor, or use WinSCP to edit the file remotly (needs SFTP installed)

root@GL-AR750:~# vi /etc/config/network

Steps to take:

  • Remove from the VLAN the LAN interface we want to configure as WAN

From:

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 0t'

To:

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 0t'
  • Create a new VLAN that includes the LAN port we want to use as WAN

Add:

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '2 0t'
  • Add a new WAN Interface that uses the new VLAN we just created (eth1.2 in this case). It needs to have a different metric and hostname.

Add:

config interface 'wan2'
	option ifname 'eth1.2'
	option proto 'dhcp'
	option hostname 'GL-AR750-bc1'
	option metric '11'
	option delegate '0'
  • Here is how the file should look after the changes (if you started from the original file)

You can download it here

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fddf:6c77:8aea::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1.1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option hostname 'GL-AR750-bc0'
	option ipaddr '192.168.10.1'
	option delegate '0'

config interface 'wan'
	option ifname 'eth0'
	option proto 'dhcp'
	option hostname 'GL-AR750-bc0'
	option metric '10'

config interface 'wan2'
	option ifname 'eth1.2'
	option proto 'dhcp'
	option hostname 'GL-AR750-bc1'
	option metric '11'
	option delegate '0'

config interface 'wan6'
	option ifname 'eth0'
	option proto 'dhcpv6'
	option auto '0'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '2 0t'

config interface 'guest'
	option ifname 'guest'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.9.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
Original network file

Applying the changes

Force a network restart:

root@GL-AR750:~# /etc/init.d/network restart

you might need to reboot

root@GL-AR750:~# reboot

Firewall configurations

You'll also need to set the firewall for the new WAN.
You can go to Network / Interfaces (http://192.168.10.1/cgi-bin/luci/admin/network/network) and Edit WAN2. Select "Firewall Settings" and add Wan2 to the Wan zone. Firewall settings

Testing

Test specific connections using ping but forcing a specific interface

    `ping -c 1 -I eth0 www.google.com`

    `ping -c 1 -I eth1.2 www.google.com`
See Ping in action

How things will show up in the web interface

OpenWRTAr750Switch

OpenWRTAr750Switch

The device

Here are both WAN connections on the device
Ar750Ports

Configure Mwan3

Now that I have 2 WAN ports in my router (that initially only had one), I can now use Mwan3 to load balance both of my internet connections.

I followed the well detailed guide to configure Mwan3.

Here is my mwan3 config file (# /etc/config/mwan3)

You can download it here

config globals 'globals'
	option enabled '1'
	option mmx_mask '0x3F00'

config interface 'wan'
	option enabled '1'
	list track_ip '8.8.4.4'
	list track_ip '8.8.8.8'
	list track_ip '208.67.222.222'
	list track_ip '208.67.220.220'
	option reliability '2'
	option count '1'
	option timeout '2'
	option interval '5'
	option down '3'
	option up '8'
 
config interface 'wan2'
	option enabled '1'
	list track_ip '8.8.8.8'
	list track_ip '208.67.220.220'
	option reliability '1'
	option count '1'
	option timeout '2'
	option interval '5'
	option down '3'
	option up '8'
 
config member 'wan_m1_w3'
	option interface 'wan'
	option metric '1'
	option weight '3'
 
config member 'wan_m2_w3'
	option interface 'wan'
	option metric '2'
	option weight '3'
 
config member 'wan2_m1_w2'
	option interface 'wan2'
	option metric '1'
	option weight '2'
 
config member 'wan2_m2_w2'
	option interface 'wan2'
	option metric '2'
	option weight '2'
 
config policy 'wan_only'
	list use_member 'wan_m1_w3'
 
config policy 'wan2_only'
	list use_member 'wan2_m1_w2'
 
config policy 'balanced'
	list use_member 'wan_m1_w3'
	list use_member 'wan2_m1_w2'
 
config policy 'wan_wan2'
	list use_member 'wan_m1_w3'
	list use_member 'wan2_m2_w2'
 
config policy 'wan2_wan'
	list use_member 'wan_m2_w3'
	list use_member 'wan2_m1_w2'
 
config rule 'sticky_even'
	option src_ip '0.0.0.0/0.0.0.1'
	option dest_port '443'
	option proto 'tcp'
	option use_policy 'wan_wan2'
 
config rule 'sticky_odd'
	option src_ip '0.0.0.1/0.0.0.1'
	option dest_port '443'
	option proto 'tcp'
	option use_policy 'wan2_wan'
 
config rule 'default_rule'
	option dest_ip '0.0.0.0/0'
	option use_policy 'balanced'

Comments

Popular posts from this blog

Masalah Deassigned assigned hotspot mikrotik

Tiba-tiba dapat masalah user hotspot terputus dari jaringan dan otomatis internet terputus.  kemudian dilakukan pengcekan log dan didapatkan log mencurigakan dhcp1 deassigned .. dhcp1 assigned ... dhcp1 deassigned .. dhcp1 assigned ... dhcp1 deassigned .. dhcp1 assigned ... dan jumlahnya sangat banyak. Identifikasi dhcp1 adalah proses dhcp server meminjamkan (assigned) dan menarik kembali (deassigned) ip address ke perangkat di jaringan. setingnya di /ip dhcp server dengan mengacukan pada /ip pool dhcp_pool0 . TAPI hotspot mikrotik juga mengacu ke pool yang sama di /ip hotspot address-pool . Solusi: disable-kan dhcp server di hotspot. caranya masuk ke  /ip hotspot address-pool seting ke none. Sumber: https://forum.mikrotik.com/viewtopic.php?t=49054 Salam, Arie B. 

Merubah Akun Default SUPERUSER ( telcomadmin dan Support ) Pada Modem Huawei HG8245A Indihome

Tujuan merubah akun default modem huawei hg8245a ini adalah untuk melindungi modem dari tangan-tangan jahil yang mau merubah setingan modem. Klo modem ini digunakan di cafee, tentu yang terjadi adalah ketidaknyamanan menggunakan internet di cafe/warkop tersebut. Ok langsung saja, jadi perlu diketahui bahwasannya modem ini bisa diakses melalui IP 192.168.100.1 dan memiliki akun default yaitu: username: telecomadmin | password: admintelecom atau username: Support | password: theworldinyourhand Nah, coba saja salah satu akun diatas, insyaAllah bisa masuk dan mendapat akses SUPERUSER. Para teknisi telkom menggunakan akun ini untuk menseting modem-modem pelanggan tanpa perlu menanyakan password modem. Kedua akun diatas derajatnya lebih tinggi dibanding akun default yang tertulis di belakang modem, yang biasanya:  username: Admin | password: admin Baik, saya akan mejelaskan cara-cara merubah kedua akun default SUPERUSER tersebut. 1. Masuk ke modem HG8245A melalui web. bi...

Menyembunyikan IP Mikrotik dari traceroute

<script data-ad-client="ca-pub-5603580849539291" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>  Pada saat melakukan traceroute, maka akan muncul hop lomptan antar perangkat-perangkat hingga sampai tujuan dari traceroute. Misalkan: tracert 8.8.8.8 C:\Users\My Love>tracert 8.8.8.8 Tracing route to dns.google [8.8.8.8] over a maximum of 30 hops:   1     3 ms     3 ms     2 ms  ikos.net [172.16.12.1]   2     *        *        *     Request timed out.   3     6 ms     *        *     10.10.12.1   4    15 ms    24 ms    26 ms  10.114.192.1   5    17 ms   ...