Add a function to check if interface exist

Signed-off-by: Yanbing Du <ydu@redhat.com>