Handle multiple subnets

Signed-off-by: Rossella Sblendido <rossella@midokura.com>

Change-Id: I2ecba9e6f1605e1e37091e073318c2f2da4fd9c5