View previous topic :: View next topic |
Author |
Message |
exeral n00b
Joined: 23 Jan 2013 Posts: 8
|
Posted: Wed Jun 12, 2013 2:57 pm Post subject: persitent virtual interface |
|
|
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 |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Wed Jun 12, 2013 3:07 pm Post subject: |
|
|
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 |
|
|
exeral n00b
Joined: 23 Jan 2013 Posts: 8
|
Posted: Wed Jun 12, 2013 4:40 pm Post subject: |
|
|
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 |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21607
|
Posted: Wed Jun 12, 2013 9:42 pm Post subject: |
|
|
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 |
|
|
exeral n00b
Joined: 23 Jan 2013 Posts: 8
|
Posted: Thu Jun 13, 2013 9:11 am Post subject: |
|
|
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 |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Wed Jun 19, 2013 11:41 am Post subject: |
|
|
What routes are there after restarting eth0? _________________ Hello 911? How are you? |
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Wed Jun 26, 2013 5:21 pm Post subject: |
|
|
Just a quick question an interface can use TWO addresses simultaneously with the ip command way??
thanks |
|
Back to top |
|
|
papahuhn l33t
Joined: 06 Sep 2004 Posts: 626
|
Posted: Wed Jun 26, 2013 6:47 pm Post subject: |
|
|
Yes. _________________ Death by snoo-snoo! |
|
Back to top |
|
|
|