#!/bin/bash
VIP=172.25.0.100
VIPCAST=172.25.0.255
RIP=192.168.88.80
DGW=172.25.0.254
DGWMAC="52:54:00:00:00:fe"
arptables -F
arptables -A IN -d $VIP -j DROP
arptables -A OUT -s $VIP -j mangle --mangle-ip-s $RIP
/sbin/ifconfig eth0:1 $VIP broadcast $VIPCAST netmask 255.255.255.0 up
arp -s $DGW $DGWMAC
/sbin/route add default gw $DGW
转载于:https://www.cnblogs.com/lihuaichen/p/8270171.html