Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
persitent virtual interface
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
exeral
n00b
n00b


Joined: 23 Jan 2013
Posts: 8

PostPosted: Wed Jun 12, 2013 2:57 pm    Post subject: persitent virtual interface Reply with quote

Hi everybody

I'm trying to setup a persistent virtual interface to add another private IP.

manually it works:
Code:
ifconfig eth0:0 192.168.10.10/24 up

"ip a" output the new ip adress on eth0

I edit /etc/conf.d/net to make it persistent:
Code:

config_eth0="my.pub.lic.ip/24 192.168.10.10/24"
routes_eth0=(
        "192.168.104.51/32 via aa.bb.cc.dd"
        "default gw xx.yy.yy.zz"
)


then I do : "/etc/init.d/net.eth0 restart"
some net dependend services restart but nothing about a new virtual interface happens.
"ip a" doesn't show anything about this virtual adress


on another server, It works with the same steps.
The difference is kernel version.
3.8.13 on working server
2.6.38.2 on non-working server

Is it related to kernel? do I have to take a look about a specific package ?

thanks
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Wed Jun 12, 2013 3:07 pm    Post subject: Reply with quote

interface alias is not at all recomendable. Use tap or macvlan better. I think some of the problems where due to iptables not being able to work with interface alias. Nobody is using this anymore.
Back to top
View user's profile Send private message
exeral
n00b
n00b


Joined: 23 Jan 2013
Posts: 8

PostPosted: Wed Jun 12, 2013 4:40 pm    Post subject: Reply with quote

It's still documented in handbook
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2

I know as described:
Quote:
You cannot do anything special with these interfaces as the kernel and other programs will just treat eth0:1 and eth0:2 as eth0


but it doesn't matter for me. I'll not use iptables on this address
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Wed Jun 12, 2013 9:42 pm    Post subject: Reply with quote

Since you have the ip command installed, openrc will prefer that for configuring interfaces. The use of interface aliases is a workaround for limitations in ifconfig. The ip command can add extra addresses without the use of interface aliases.
Back to top
View user's profile Send private message
exeral
n00b
n00b


Joined: 23 Jan 2013
Posts: 8

PostPosted: Thu Jun 13, 2013 9:11 am    Post subject: Reply with quote

I could add
Code:
/sbin/ip address add 192.168.10.10/24 dev eth0

to /etc/rc.local but i think it's not the best way
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1226

PostPosted: Wed Jun 19, 2013 11:41 am    Post subject: Reply with quote

What routes are there after restarting eth0?
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Wed Jun 26, 2013 5:21 pm    Post subject: Reply with quote

Just a quick question an interface can use TWO addresses simultaneously with the ip command way??

thanks
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Wed Jun 26, 2013 6:47 pm    Post subject: Reply with quote

Yes.
_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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