Made changes to set gateway even for non public interfaces also, if gateway value is specified