Discussion:
control of order of inet devices
(too old to reply)
Willy Offermans
2013-04-16 13:57:51 UTC
Permalink
Dear FreeBSD friends,

How can I control the order of the network devices in FreeBSD.

For example, the command ifconfig lists the network devices:

pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:0c:46:ea:2b:32
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet 100baseFX
status: no carrier
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2008<VLAN_MTU,WOL_MAGIC>
ether 00:11:6b:99:7c:5a
inet XXX.XXX.24.4 netmask 0xffffff80 broadcast 137.226.24.127
inet6 fe80::211:6bff:fe99:7c5a%rl0 prefixlen 64 scopeid 0x4
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nfe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
ether 00:1b:fc:df:a1:33
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:22:19:10:8d:bb
inet XXX.XXX.24.19 netmask 0xffffffff broadcast 137.226.24.19
inet6 fe80::2bd:83ff:fe68:7200%tap0 prefixlen 64 scopeid 0x8
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier

pcn0 being first. However, I would like tap0 being first and of course
without any output ordering trick.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Wiel

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl

Powered by ....

(__)
\\\'',)
\/ \ ^
.\._/_)

www.FreeBSD.org
Brooks Davis
2013-04-16 15:44:31 UTC
Permalink
Post by Willy Offermans
Dear FreeBSD friends,
How can I control the order of the network devices in FreeBSD.
pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:0c:46:ea:2b:32
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet 100baseFX
status: no carrier
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2008<VLAN_MTU,WOL_MAGIC>
ether 00:11:6b:99:7c:5a
inet XXX.XXX.24.4 netmask 0xffffff80 broadcast 137.226.24.127
inet6 fe80::211:6bff:fe99:7c5a%rl0 prefixlen 64 scopeid 0x4
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nfe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
ether 00:1b:fc:df:a1:33
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:22:19:10:8d:bb
inet XXX.XXX.24.19 netmask 0xffffffff broadcast 137.226.24.19
inet6 fe80::2bd:83ff:fe68:7200%tap0 prefixlen 64 scopeid 0x8
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier
pcn0 being first. However, I would like tap0 being first and of course
without any output ordering trick.
The order is dictated by the order the drivers are probed by the kernel.
When the devices are created they are added to a linked list. There is
no practical way to control the order and it has little or no effect.

-- Brooks
Adrian Chadd
2013-04-16 17:09:09 UTC
Permalink
Since people keep asking about this; maybe it's time we added a hint
to the bus code that allows for the unit to be set based on the pci
bus / slot / etc.



Adrian
Brooks Davis
2013-04-16 18:36:25 UTC
Permalink
Post by Adrian Chadd
Since people keep asking about this; maybe it's time we added a hint
to the bus code that allows for the unit to be set based on the pci
bus / slot / etc.
I don't see how that would address Willy's request. Neither the unit
number or the if_index of an interface effects its order in
getifaddrs() output.

With modern bus hierarchies, you probably don't want to use the unit
anyway as it loses too much information. Some along the lines of
Fedora's Consistent Network Device Naming would likely be more useful.
That would be fairly easy to implement.

-- Brooks
Mehmet Erol Sanliturk
2013-04-16 19:03:31 UTC
Permalink
Post by Brooks Davis
Post by Adrian Chadd
Since people keep asking about this; maybe it's time we added a hint
to the bus code that allows for the unit to be set based on the pci
bus / slot / etc.
I don't see how that would address Willy's request. Neither the unit
number or the if_index of an interface effects its order in
getifaddrs() output.
With modern bus hierarchies, you probably don't want to use the unit
anyway as it loses too much information. Some along the lines of
Fedora's Consistent Network Device Naming would likely be more useful.
That would be fairly easy to implement.
-- Brooks
Fedora is using eth0 , ... , eth9 , but FreeBSD is using em* , re* , ..
names which is much better than Fedora ( or similar distributions )
approach .

In eth0 , ... , usage , it is necessary to record MAC addresses of the NIC
units ( because any name is not displayed like FreeBSD ) BEFORE starting
an installation to isolate which one is referenced : Even this is not very
useful sometimes because I am seeing they ( different Linux distributions )
are reporting MAC addresses differently for some NIC units , and no one of
them is identical to others to number eth with existing NIC units ( for
example , eth0 is not used for the same NIC by all the distributions , i.e.
, there is no any standard numbering scheme ) .

FreeBSD is using names ( Realtek , Intel , etc with other information also
) which is very easy to understand which NIC unit is referenced .

I think , in FreeBSD , the problem may occur when all of the NIC units are
the same model .
For such cases , there is a necessity to display also slot / port
information ( in that case MAC address is not showing slot / port
information ) .

Thank you very much .

Mehmet Erol Sanliturk
Brooks Davis
2013-04-16 19:06:39 UTC
Permalink
Post by Mehmet Erol Sanliturk
Post by Brooks Davis
Post by Adrian Chadd
Since people keep asking about this; maybe it's time we added a hint
to the bus code that allows for the unit to be set based on the pci
bus / slot / etc.
I don't see how that would address Willy's request. Neither the unit
number or the if_index of an interface effects its order in
getifaddrs() output.
With modern bus hierarchies, you probably don't want to use the unit
anyway as it loses too much information. Some along the lines of
Fedora's Consistent Network Device Naming would likely be more useful.
That would be fairly easy to implement.
-- Brooks
Fedora is using eth0 , ... , eth9 , but FreeBSD is using em* , re* , ..
names which is much better than Fedora ( or similar distributions )
approach .
As of Fedora 16 the default was changed:

http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/appe-Consistent_Network_Device_Naming.html

-- Brooks
Dimitry Andric
2013-04-16 20:04:55 UTC
Permalink
Post by Brooks Davis
Post by Adrian Chadd
Since people keep asking about this; maybe it's time we added a hint
to the bus code that allows for the unit to be set based on the pci
bus / slot / etc.
I don't see how that would address Willy's request. Neither the unit
number or the if_index of an interface effects its order in
getifaddrs() output.
With modern bus hierarchies, you probably don't want to use the unit
anyway as it loses too much information. Some along the lines of
Fedora's Consistent Network Device Naming would likely be more useful.
That would be fairly easy to implement.
I've been using the ifconfig_XXX_name setting in rc.conf for years now,
which at works fine, at least for me. E.g.:

ifconfig_em0_name="if_ext"
ifconfig_em1_name="if_lan"
ifconfig_ral0_name="if_wifi"

However, if bus enumeration would randomly swap em0 and em1, for
example, this would break down. Linux usually just fixes a specific
interface name to a hardware address, e.g.
/etc/sysconfig/network-scripts/ifcfg-eth0 on a CentOS box has:

DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:65:E4:E3"
..
Willy Offermans
2013-04-17 09:15:36 UTC
Permalink
Hello Brooks,
Post by Brooks Davis
Post by Willy Offermans
Dear FreeBSD friends,
How can I control the order of the network devices in FreeBSD.
pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:0c:46:ea:2b:32
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet 100baseFX
status: no carrier
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=2008<VLAN_MTU,WOL_MAGIC>
ether 00:11:6b:99:7c:5a
inet XXX.XXX.24.4 netmask 0xffffff80 broadcast 137.226.24.127
inet6 fe80::211:6bff:fe99:7c5a%rl0 prefixlen 64 scopeid 0x4
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nfe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
ether 00:1b:fc:df:a1:33
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:22:19:10:8d:bb
inet XXX.XXX.24.19 netmask 0xffffffff broadcast 137.226.24.19
inet6 fe80::2bd:83ff:fe68:7200%tap0 prefixlen 64 scopeid 0x8
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier
pcn0 being first. However, I would like tap0 being first and of course
without any output ordering trick.
The order is dictated by the order the drivers are probed by the kernel.
When the devices are created they are added to a linked list. There is
no practical way to control the order and it has little or no effect.
-- Brooks
This is what I read in some of the articles or handbook as well. Can I
reorder this linked list? Can I control the order by creating the kernel
and reordering the inclusion of the device drivers?

I am aware that the request sounds silly, but I have a third party program
which checks its licence against the first inet device. Since I have added
a new inet controller, the sequence has changed. Of course I ask for a new
licence, but they want to charge me for that and I do not see any reason
for that.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl

Powered by ....

(__)
\\\'',)
\/ \ ^
.\._/_)

www.FreeBSD.org
Scot Hetzel
2013-04-18 04:55:21 UTC
Permalink
On Wed, Apr 17, 2013 at 4:14 AM, Willy Offermans
Post by Willy Offermans
Hello Brooks,
Post by Brooks Davis
Post by Willy Offermans
Dear FreeBSD friends,
How can I control the order of the network devices in FreeBSD.
pcn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
ether 00:0c:46:ea:2b:32
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet 100baseFX
status: no carrier
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
1500
Post by Brooks Davis
Post by Willy Offermans
options=2008<VLAN_MTU,WOL_MAGIC>
ether 00:11:6b:99:7c:5a
inet XXX.XXX.24.4 netmask 0xffffff80 broadcast 137.226.24.127
inet6 fe80::211:6bff:fe99:7c5a%rl0 prefixlen 64 scopeid 0x4
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nfe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
ether 00:1b:fc:df:a1:33
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
1500
Post by Brooks Davis
Post by Willy Offermans
options=80000<LINKSTATE>
ether 00:22:19:10:8d:bb
inet XXX.XXX.24.19 netmask 0xffffffff broadcast 137.226.24.19
inet6 fe80::2bd:83ff:fe68:7200%tap0 prefixlen 64 scopeid 0x8
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier
pcn0 being first. However, I would like tap0 being first and of course
without any output ordering trick.
The order is dictated by the order the drivers are probed by the kernel.
When the devices are created they are added to a linked list. There is
no practical way to control the order and it has little or no effect.
-- Brooks
This is what I read in some of the articles or handbook as well. Can I
reorder this linked list? Can I control the order by creating the kernel
and reordering the inclusion of the device drivers?
I am aware that the request sounds silly, but I have a third party program
which checks its licence against the first inet device. Since I have added
a new inet controller, the sequence has changed. Of course I ask for a new
licence, but they want to charge me for that and I do not see any reason
for that.
What information did you give them when you registered that software? Was
it just the MAC address of tap0?

If it was just the MAC address of tap0, you could try changing the MAC
address of pcn0 to the MAC address of tap0:

echo 'ifconfig pcn0 ether 00:22:19:10:8d:bb' >/etc/start_if.pcn0
echo 'ifconfig tap0 ether 00:22:19:10:8d:bc' >/etc/start_if.tap0

Loading...