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.mdOpenWrt - 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
- Applying the changes
- Firewall configurations
- Testing
- How things will show up in the web interface
- Configure Mwan3
- Troubleshooting
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.bakThe 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/networkSteps 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 restartyou might need to reboot
root@GL-AR750:~# rebootFirewall 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.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
- The Interfaces (in my case http://192.168.10.1/cgi-bin/luci/admin/network/network)
- The Switch (in my case http://192.168.10.1/cgi-bin/luci/admin/network/vlan)
The device
Here are both WAN connections on the device
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
Post a Comment