This is best achieved using HIPS by creating Location aware groups(CAG’s or LAG’s)
User can create CAG’s in HIPS to define inside and outside network and create rules to manage traffic. (applicable to Windows and Mac)
Find below KB article link for CAG.
I moved this to Mac and Linux Products as a better spot for it.