Deployment Manual
23
4. Execute the
cd tools/
command to go to the tools directory in the program.
5. Execute the
vi set_bond_config.sh
command. Press
i
on the keyboard to switch to the editing mode, and then modify the IP address of the
server (HOST_IP, HOST_GATEWAY, HOST_MASK). After compeletion, press
Esc
, and then input
:wq
to save the change.[root@localhost base]#
vi set_bond_config.sh
#!/bin/bash
# set ip address
HOST_IP=xx.xx.xx.xx #Change to actual IP address
HOST_GATEWAY=xx.xx.xx.xx #Change to actual gateway
HOST_MASK=255.255.0.0 #Change to actual subnet mask
cd /etc/sysconfig/network-scripts/
#set bond0
echo 'DEVICE=bond0' >ifcfg-bond0
echo 'BOOTPROTO=static'>>ifcfg-bond0
echo 'DEFROUTE=yes'>>ifcfg-bond0
echo 'ONBOOT=yes'>>ifcfg-bond0
echo 'TYPE=Ethernet'>>ifcfg-bond0
echo IPADDR=$HOST_IP>>ifcfg-bond0
echo NETMASK=$HOST_MASK>>ifcfg-bond0
echo GATEWAY=$HOST_GATEWAY>>ifcfg-bond0
echo 'BONDING_OPTS="resend_igmp=1 updelay=0 use_carrier=1
arp_all_targets=any miimon=100 lp_interval=1 min_links=0 downdelay=0
xmit_hash_policy=layer2 primary_reselect=always fail_over_mac=none
arp_validate=none mode=active-backup all_subs_active=0 arp_interval=0
ad_select=stable num_unsol_na=1 num_grat_arp=1"'>>ifcfg-bond0
Step 4
Execute the
sh set_bond_config.sh
command to execute the script.
[root@rabbitmq1 home]#
sh set_bond_config.sh
/root
The network has been set active-backup mode successfully!
If the above-mentioned message appears, it means that the script was successfully
executed.
Step 5
Execute the
reboot
command to restart the server.
Step 6
Execute the
ifconfig
command to check whether the IP address was successfully modified.
[root@rabbitmq1 tools]#
ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,M A S T E R,MULTICAST> mtu 1500
inet 192.168.1.135 netmask 255.255.0.0 broadcast 192.168.255.255
inet6 fe80::ae1f:6bff:fed0:8dc5 prefixlen 64 scopeid 0x20<link>
ether ac:1f:6b:d0:8d:c5 txqueuelen 1000 (Ethernet)
Summary of Contents for DH-IVS-IP8000-E-GU1
Page 65: ...Deployment Manual...