1 |
On Thursday, January 17, 2019 10:37:32 PM CET Alarig Le Lay wrote: |
2 |
> Hi, |
3 |
> |
4 |
> I would like to set the alias of my interfaces at boot (if possible with |
5 |
> netifrc). |
6 |
> |
7 |
> Here are the relevant parts of my configuration: |
8 |
> config_enp3s0f0="null" |
9 |
> vlans_enp3s0f0="20 21 22 50" |
10 |
> config_enp3s0f0_22="185.1.89.13/24 2001:7f8:b1::d/64" |
11 |
> |
12 |
> My interface is well created, but if I want an alias, I have to do it by |
13 |
> hand: |
14 |
> asbr02 ~ # ip addr show enp3s0f0.22 |
15 |
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc |
16 |
> noqueue state UP group default qlen 1000 link/ether 00:1b:21:48:68:98 brd |
17 |
> ff:ff:ff:ff:ff:ff |
18 |
> inet 185.1.89.13/24 brd 185.1.89.255 scope global enp3s0f0.22 |
19 |
> valid_lft forever preferred_lft forever |
20 |
> inet6 2001:7f8:b1::d/64 scope global |
21 |
> valid_lft forever preferred_lft forever |
22 |
> inet6 fe80::21b:21ff:fe48:6898/64 scope link |
23 |
> valid_lft forever preferred_lft forever |
24 |
> asbr02 ~ # ip link set enp3s0f0.22 alias "Peering: BreizhIX" |
25 |
> asbr02 ~ # ip link show enp3s0f0.22 |
26 |
> 11: enp3s0f0.22@enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc |
27 |
> noqueue state UP mode DEFAULT group default qlen 1000 link/ether |
28 |
> 00:1b:21:48:68:98 brd ff:ff:ff:ff:ff:ff |
29 |
> alias Peering: BreizhIX |
30 |
> |
31 |
> On FreeBSD, I did that with an /etc/start_if script: |
32 |
> ifconfig igb0.22 create |
33 |
> ifconfig igb0.22 description "Peering: BreizhIX" |
34 |
> ifconfig igb0.22 vlan 22 vlandev igb0 |
35 |
> ifconfig igb0.22 inet 185.1.89.13/24 |
36 |
> ifconfig igb0.22 inet6 2001:7f8:b1::d/64 |
37 |
> |
38 |
> |
39 |
> I didn’t find any mention of this in |
40 |
> /usr/share/doc/netifrc-0.5.1/net.example.bz2 |
41 |
> |
42 |
> Am I missing something? |
43 |
|
44 |
Not sure if you can use spaces in the name, but I have the following: |
45 |
|
46 |
$ cat /etc/conf.d/net |
47 |
#config_eno1="dhcp" |
48 |
|
49 |
config_eno1="null" |
50 |
vlans_eno1="10 15" |
51 |
vlan10_name="adm" |
52 |
vlan15_name="str" |
53 |
rc_net_adm_need="net.eno1" |
54 |
rc_net_str_need="net.eno1" |
55 |
config_adm="10.55.16.44 netmask 255.255.255.0 broadcast 10.55.16.255" |
56 |
routes_adm="default gw 10.55.16.68" |
57 |
config_str="10.30.15.44 netmask 255.255.255.0 broadcast 10.30.15.255" |
58 |
|
59 |
For this to work, configured the init-scripts as: |
60 |
|
61 |
$ ls -l /etc/init.d/net.* |
62 |
lrwxrwxrwx 1 root root 6 Jun 16 2016 /etc/init.d/net.adm -> net.lo |
63 |
lrwxrwxrwx 1 root root 6 Jun 15 2016 /etc/init.d/net.eno1 -> net.lo |
64 |
-rwxr-xr-x 1 root root 18514 Mar 2 2018 /etc/init.d/net.lo |
65 |
lrwxrwxrwx 1 root root 6 Jun 16 2016 /etc/init.d/net.str -> net.lo |
66 |
|
67 |
And only have to add "net.adm" and "net.str" to the runlevel. |
68 |
|
69 |
-- |
70 |
Joost Roeleveld |