public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Set the alias of an interface with netifrc
@ 2019-01-17 21:37 Alarig Le Lay
  2019-01-18 12:20 ` Mick
  2019-01-19 11:02 ` J. Roeleveld
  0 siblings, 2 replies; 7+ messages in thread
From: Alarig Le Lay @ 2019-01-17 21:37 UTC (permalink / raw
  To: gentoo-user

Hi,

I would like to set the alias of my interfaces at boot (if possible with
netifrc).

Here are the relevant parts of my configuration:
config_enp3s0f0="null"
vlans_enp3s0f0="20 21 22 50"
config_enp3s0f0_22="185.1.89.13/24 2001:7f8:b1::d/64"

My interface is well created, but if I want an alias, I have to do it by
hand:
asbr02 ~ # ip addr show enp3s0f0.22
11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:1b:21:48:68:98 brd ff:ff:ff:ff:ff:ff
    inet 185.1.89.13/24 brd 185.1.89.255 scope global enp3s0f0.22
       valid_lft forever preferred_lft forever
    inet6 2001:7f8:b1::d/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::21b:21ff:fe48:6898/64 scope link 
       valid_lft forever preferred_lft forever
asbr02 ~ # ip link set enp3s0f0.22 alias "Peering: BreizhIX"
asbr02 ~ # ip link show enp3s0f0.22
11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 00:1b:21:48:68:98 brd ff:ff:ff:ff:ff:ff
    alias Peering: BreizhIX

On FreeBSD, I did that with an /etc/start_if script:
ifconfig igb0.22 create
ifconfig igb0.22 description "Peering: BreizhIX"
ifconfig igb0.22 vlan 22 vlandev igb0
ifconfig igb0.22 inet 185.1.89.13/24
ifconfig igb0.22 inet6 2001:7f8:b1::d/64


I didn’t find any mention of this in /usr/share/doc/netifrc-0.5.1/net.example.bz2

Am I missing something?

Thanks,
-- 
Alarig


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-17 21:37 [gentoo-user] Set the alias of an interface with netifrc Alarig Le Lay
@ 2019-01-18 12:20 ` Mick
  2019-01-19 11:02 ` J. Roeleveld
  1 sibling, 0 replies; 7+ messages in thread
From: Mick @ 2019-01-18 12:20 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

On Thursday, 17 January 2019 21:37:32 GMT Alarig Le Lay wrote:
> Hi,
> 
> I would like to set the alias of my interfaces at boot (if possible with
> netifrc).
> 
> Here are the relevant parts of my configuration:
> config_enp3s0f0="null"
> vlans_enp3s0f0="20 21 22 50"
> config_enp3s0f0_22="185.1.89.13/24 2001:7f8:b1::d/64"
> 
> My interface is well created, but if I want an alias, I have to do it by
> hand:
> asbr02 ~ # ip addr show enp3s0f0.22
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> noqueue state UP group default qlen 1000 link/ether 00:1b:21:48:68:98 brd
> ff:ff:ff:ff:ff:ff
>     inet 185.1.89.13/24 brd 185.1.89.255 scope global enp3s0f0.22
>        valid_lft forever preferred_lft forever
>     inet6 2001:7f8:b1::d/64 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::21b:21ff:fe48:6898/64 scope link
>        valid_lft forever preferred_lft forever
> asbr02 ~ # ip link set enp3s0f0.22 alias "Peering: BreizhIX"
> asbr02 ~ # ip link show enp3s0f0.22
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> noqueue state UP mode DEFAULT group default qlen 1000 link/ether
> 00:1b:21:48:68:98 brd ff:ff:ff:ff:ff:ff
>     alias Peering: BreizhIX
> 
> On FreeBSD, I did that with an /etc/start_if script:
> ifconfig igb0.22 create
> ifconfig igb0.22 description "Peering: BreizhIX"
> ifconfig igb0.22 vlan 22 vlandev igb0
> ifconfig igb0.22 inet 185.1.89.13/24
> ifconfig igb0.22 inet6 2001:7f8:b1::d/64
> 
> 
> I didn’t find any mention of this in
> /usr/share/doc/netifrc-0.5.1/net.example.bz2
> 
> Am I missing something?
> 
> Thanks,

Would something like this work?

 vlan22_name="Peering: BreizhIX"

Or,

 enp3s0f0_22_name="Peering: BreizhIX"

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-17 21:37 [gentoo-user] Set the alias of an interface with netifrc Alarig Le Lay
  2019-01-18 12:20 ` Mick
@ 2019-01-19 11:02 ` J. Roeleveld
  2019-01-19 14:36   ` Alarig Le Lay
  1 sibling, 1 reply; 7+ messages in thread
From: J. Roeleveld @ 2019-01-19 11:02 UTC (permalink / raw
  To: gentoo-user

On Thursday, January 17, 2019 10:37:32 PM CET Alarig Le Lay wrote:
> Hi,
> 
> I would like to set the alias of my interfaces at boot (if possible with
> netifrc).
> 
> Here are the relevant parts of my configuration:
> config_enp3s0f0="null"
> vlans_enp3s0f0="20 21 22 50"
> config_enp3s0f0_22="185.1.89.13/24 2001:7f8:b1::d/64"
> 
> My interface is well created, but if I want an alias, I have to do it by
> hand:
> asbr02 ~ # ip addr show enp3s0f0.22
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> noqueue state UP group default qlen 1000 link/ether 00:1b:21:48:68:98 brd
> ff:ff:ff:ff:ff:ff
>     inet 185.1.89.13/24 brd 185.1.89.255 scope global enp3s0f0.22
>        valid_lft forever preferred_lft forever
>     inet6 2001:7f8:b1::d/64 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::21b:21ff:fe48:6898/64 scope link
>        valid_lft forever preferred_lft forever
> asbr02 ~ # ip link set enp3s0f0.22 alias "Peering: BreizhIX"
> asbr02 ~ # ip link show enp3s0f0.22
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> noqueue state UP mode DEFAULT group default qlen 1000 link/ether
> 00:1b:21:48:68:98 brd ff:ff:ff:ff:ff:ff
>     alias Peering: BreizhIX
> 
> On FreeBSD, I did that with an /etc/start_if script:
> ifconfig igb0.22 create
> ifconfig igb0.22 description "Peering: BreizhIX"
> ifconfig igb0.22 vlan 22 vlandev igb0
> ifconfig igb0.22 inet 185.1.89.13/24
> ifconfig igb0.22 inet6 2001:7f8:b1::d/64
> 
> 
> I didn’t find any mention of this in
> /usr/share/doc/netifrc-0.5.1/net.example.bz2
> 
> Am I missing something?

Not sure if you can use spaces in the name, but I have the following:

$ cat /etc/conf.d/net
#config_eno1="dhcp"

config_eno1="null"
vlans_eno1="10 15"
vlan10_name="adm"
vlan15_name="str"
rc_net_adm_need="net.eno1"
rc_net_str_need="net.eno1"
config_adm="10.55.16.44 netmask 255.255.255.0 broadcast 10.55.16.255"
routes_adm="default gw 10.55.16.68"
config_str="10.30.15.44 netmask 255.255.255.0 broadcast 10.30.15.255"

For this to work, configured the init-scripts as:

$ ls -l /etc/init.d/net.*
lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.adm -> net.lo
lrwxrwxrwx 1 root root     6 Jun 15  2016 /etc/init.d/net.eno1 -> net.lo
-rwxr-xr-x 1 root root 18514 Mar  2  2018 /etc/init.d/net.lo
lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.str -> net.lo

And only have to add "net.adm" and "net.str" to the runlevel.

--
Joost Roeleveld





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-19 11:02 ` J. Roeleveld
@ 2019-01-19 14:36   ` Alarig Le Lay
  2019-01-19 15:45     ` J. Roeleveld
  0 siblings, 1 reply; 7+ messages in thread
From: Alarig Le Lay @ 2019-01-19 14:36 UTC (permalink / raw
  To: gentoo-user

Hi,

On sam. 19 janv. 12:02:20 2019, J. Roeleveld wrote:
> Not sure if you can use spaces in the name, but I have the following:
> 
> $ cat /etc/conf.d/net
> #config_eno1="dhcp"
> 
> config_eno1="null"
> vlans_eno1="10 15"
> vlan10_name="adm"
> vlan15_name="str"
> rc_net_adm_need="net.eno1"
> rc_net_str_need="net.eno1"
> config_adm="10.55.16.44 netmask 255.255.255.0 broadcast 10.55.16.255"
> routes_adm="default gw 10.55.16.68"
> config_str="10.30.15.44 netmask 255.255.255.0 broadcast 10.30.15.255"
> 
> For this to work, configured the init-scripts as:
> 
> $ ls -l /etc/init.d/net.*
> lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.adm -> net.lo
> lrwxrwxrwx 1 root root     6 Jun 15  2016 /etc/init.d/net.eno1 -> net.lo
> -rwxr-xr-x 1 root root 18514 Mar  2  2018 /etc/init.d/net.lo
> lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.str -> net.lo
> 
> And only have to add "net.adm" and "net.str" to the runlevel.

I don’t want to change the name of my interfaces, but the equivalent of
`ip link set ${if} alias "${whatever}"`.

-- 
Alarig


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-19 14:36   ` Alarig Le Lay
@ 2019-01-19 15:45     ` J. Roeleveld
  2019-01-20  0:29       ` Alarig Le Lay
  0 siblings, 1 reply; 7+ messages in thread
From: J. Roeleveld @ 2019-01-19 15:45 UTC (permalink / raw
  To: gentoo-user

On Saturday, January 19, 2019 3:36:15 PM CET Alarig Le Lay wrote:
> Hi,
> 
> On sam. 19 janv. 12:02:20 2019, J. Roeleveld wrote:
> > Not sure if you can use spaces in the name, but I have the following:
> > 
> > $ cat /etc/conf.d/net
> > #config_eno1="dhcp"
> > 
> > config_eno1="null"
> > vlans_eno1="10 15"
> > vlan10_name="adm"
> > vlan15_name="str"
> > rc_net_adm_need="net.eno1"
> > rc_net_str_need="net.eno1"
> > config_adm="10.55.16.44 netmask 255.255.255.0 broadcast 10.55.16.255"
> > routes_adm="default gw 10.55.16.68"
> > config_str="10.30.15.44 netmask 255.255.255.0 broadcast 10.30.15.255"
> > 
> > For this to work, configured the init-scripts as:
> > 
> > $ ls -l /etc/init.d/net.*
> > lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.adm -> net.lo
> > lrwxrwxrwx 1 root root     6 Jun 15  2016 /etc/init.d/net.eno1 -> net.lo
> > -rwxr-xr-x 1 root root 18514 Mar  2  2018 /etc/init.d/net.lo
> > lrwxrwxrwx 1 root root     6 Jun 16  2016 /etc/init.d/net.str -> net.lo
> > 
> > And only have to add "net.adm" and "net.str" to the runlevel.
> 
> I don’t want to change the name of my interfaces, but the equivalent of
> `ip link set ${if} alias "${whatever}"`.

Not sure if that is actually "supported" by netifrc.
You could add these commands in a postup() block.

Is there a specific benefit for just setting an "alias" like this?

--
Joost




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-19 15:45     ` J. Roeleveld
@ 2019-01-20  0:29       ` Alarig Le Lay
  2019-01-24  5:53         ` J. Roeleveld
  0 siblings, 1 reply; 7+ messages in thread
From: Alarig Le Lay @ 2019-01-20  0:29 UTC (permalink / raw
  To: gentoo-user

On sam. 19 janv. 16:45:42 2019, J. Roeleveld wrote:
> Not sure if that is actually "supported" by netifrc.
> You could add these commands in a postup() block.

I did that, thanks!

> Is there a specific benefit for just setting an "alias" like this?

Yes, knowing what each interface is used for.

-- 
Alarig


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Set the alias of an interface with netifrc
  2019-01-20  0:29       ` Alarig Le Lay
@ 2019-01-24  5:53         ` J. Roeleveld
  0 siblings, 0 replies; 7+ messages in thread
From: J. Roeleveld @ 2019-01-24  5:53 UTC (permalink / raw
  To: gentoo-user

On Sunday, January 20, 2019 1:29:48 AM CET Alarig Le Lay wrote:
> On sam. 19 janv. 16:45:42 2019, J. Roeleveld wrote:
> > Not sure if that is actually "supported" by netifrc.
> > You could add these commands in a postup() block.
> 
> I did that, thanks!
> 
> > Is there a specific benefit for just setting an "alias" like this?
> 
> Yes, knowing what each interface is used for.

That's why I rename the interfaces. That works in all tools and also makes the 
config easier.

--
Joost





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-24  5:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-17 21:37 [gentoo-user] Set the alias of an interface with netifrc Alarig Le Lay
2019-01-18 12:20 ` Mick
2019-01-19 11:02 ` J. Roeleveld
2019-01-19 14:36   ` Alarig Le Lay
2019-01-19 15:45     ` J. Roeleveld
2019-01-20  0:29       ` Alarig Le Lay
2019-01-24  5:53         ` J. Roeleveld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox