# How do I create a virtual network interface?

## iandow

Can anyone tell me how I can create a virtual network interface?  I also need to know how to destroy it.

Thanks for any help.

-ian

----------

## badchien

```
# ifconfig eth0:0 192.168.101.101

# ifconfig eth0:0 up

# ifconfig eth0:0 down
```

Alteratively, you can use this section in /etc/conf.d/net:

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

----------

## iandow

What's the ":0" mean in eth0:0?  Is that a seperate device from eth0?

Thanks for the reply.

-ian

----------

## j-m

 *iandow wrote:*   

> What's the ":0" mean in eth0:0?  Is that a seperate device from eth0?
> 
> Thanks for the reply.
> 
> -ian

 

No, it isn't. Using iproute2 instead of net-tools avoids such confusion...

```

# ip address show

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000

    link/ether 00:50:8d:ed:09:86 brd ff:ff:ff:ff:ff:ff

    inet xxx.yyy.41.113/29 brd xxx.yyy.41.119 scope global eth0

    inet xxx.yyy.41.114/29 brd xxx.yyy.41.119 scope global secondary eth0

    inet xxx.yyy.41.115/29 brd xxx.yyy.41.119 scope global secondary eth0

    inet xxx.yyy.41.116/29 brd xxx.yyy.41.119 scope global secondary eth0

    inet xxx.yyy.41.117/29 brd xxx.yyy.41.119 scope global secondary eth0

```

----------

## badchien

It's just an alias for that device. You can make eth0:0, eth0:1, eth0:2... and so on.

----------

