Code:
on *:connect: .protect $address($me,2)


The -w switch makes the protect apply to any network.