context ubuntu: flush ip address before configuring

(cherry picked from commit 1e429998f12e5ed4e2c40ae95d1bd613081f8144)
context ubuntu: cleanup unused code

(cherry picked from commit 6cecb17f2d9653d97f3004edf42f25c20c596fc2)