OEM agent connection

if i connecting OEM agents to the controller , agents must be in the same network?

EAM need to be able to access the controller over the network, yes. It doesn't explicitly have to be the same network, they just must be able to resolve one another.

If the gateways are not in same network , how it would connect?, could you explain me more, I could not find any notes for that, port (8088/8068) its help to connect?