Allied Telesis Routers and Switches manual Create the Scripts

Models: Routers and Switches

1 15
Download 15 pages 18.5 Kb
Page 9
Image 9
Create the Scripts

Create the Scripts

This section describes the scripts that the trigger facility runs when the master or slave load balancer changes. Create the same scripts on both load balancer 1 and load balancer 2.

Create the scripts in a text editor on your PC. You can then open the router’s editor by using the command edit master.scp (or edit slave.scp) and copy and paste the text of the script into the editor. Use Ctrl+K+X to save the script and exit.

Alternatively, you can copy your PC-created script to a TFTP server and use the router’s load command to download the files from the server.

!Script for when a load balancer becomes the master: master.scp

#Add the load balancer virtual interface (vlan2-1) to the firewall policy

#as a public interface.

#

add firewall policy=lb int=vlan2-1 type=public

#Add an allow rule for web traffic access. Note that this rule does not map

#to a private address, as expected on a NAT firewall. It just opens the port.

#The load balancer handles security and NAT redirection to the server.

#

add firewall policy=lb rule=1 int=vlan2-1 action=allow protocol=tcp port=80

#Set the VRRP priority level to a value higher than the slave's priority.

set vrrp=2 priority=200

!Script for when a load balancer becomes the slave: slave.scp

#Remove the load balancer virtual interface (vlan2-1).

#

delete firewall policy=lb int=vlan2-1

#Remove the associated access rule.

delete firewall policy=lb rule=1

#Set the VRRP priority level to a value lower than the master's priority.

set vrrp=2 priority=100

Configure Load Balancer Redundancy on Allied Telesis Routers and Switches

9

Page 9
Image 9
Allied Telesis Routers and Switches Create the Scripts, Script for when a load balancer becomes the master master.scp