---
name: "dev_change_net_namespace"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/dev_change_net_namespace"
---

# dev\_change\_net\_namespace(9)

move device to different nethost namespace

## NAME

dev\_change\_net\_namespace - move device to different nethost namespace

## SYNOPSIS

**int dev\_change\_net\_namespace(struct net\_device \*** *dev***, struct net \*** *net***, const char \*** *pat***);**

## ARGUMENTS

*dev*

device

*net*

network namespace

*pat*

If not NULL name pattern to try if the current device name is already taken in the destination network namespace.

## DESCRIPTION

This function shuts down a device interface and moves it to a new network namespace. On success 0 is returned, on a failure a netagive errno code is returned.

Callers must hold the rtnl semaphore.

## COPYRIGHT
