fix(networking): set UP veth device in host netns after creation
@@ -55,6 +55,14 @@ func CreateVethPair(hostVethName, gatewayVethName string, hostNetns, gatewayNetn
if err != nil {
return fmt.Errorf("an error occurred while creating veth pair between host and gateway namespace: %w", err)
}
+ hostIface, err := netlink.LinkByName(hostVethName)
+ if err != nil {
+ return fmt.Errorf("an error occurred while getting interface {%s} in host netns with path {%s}: %v", hostVethName, hostNetns.Path(), err)
+ }
+
+ if err = netlink.LinkSetUp(hostIface); err != nil {
+ return fmt.Errorf("an error occurred while setting UP interface {%s} in host netns with path {%s}: %v", hostVethName, hostNetns.Path(), err)
+ }
return nil
}
// If we just delete the old network namespace it would require some time for the kernel to
