Closure of Afghan border illegal: envoy