bug fix

fix a bug when gateway address is not 192.168.x.x;
now we assume  that the first part of gateway address is the same as
local address