Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I create a virtual network interface?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
iandow
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2004
Posts: 135
Location: Washington, DC

PostPosted: Tue Nov 22, 2005 2:51 pm    Post subject: How do I create a virtual network interface? Reply with quote

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
Back to top
View user's profile Send private message
badchien
Guru
Guru


Joined: 16 Feb 2004
Posts: 415
Location: doghouse

PostPosted: Tue Nov 22, 2005 2:58 pm    Post subject: Reply with quote

Code:
# 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"
Back to top
View user's profile Send private message
iandow
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2004
Posts: 135
Location: Washington, DC

PostPosted: Tue Nov 22, 2005 3:58 pm    Post subject: Reply with quote

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

Thanks for the reply.

-ian
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Tue Nov 22, 2005 4:07 pm    Post subject: Reply with quote

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...

Code:

# 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
Back to top
View user's profile Send private message
badchien
Guru
Guru


Joined: 16 Feb 2004
Posts: 415
Location: doghouse

PostPosted: Tue Nov 22, 2005 9:47 pm    Post subject: Reply with quote

It's just an alias for that device. You can make eth0:0, eth0:1, eth0:2... and so on.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum