The official llllloooooo blog

Monday, November 2, 2020

ifconfig in LFS doesn't display IPv6 information

The default version of ifconfig installed as part of Linux From Scratch doesn't work for IPv6. It doesn't display any ipv6 info as per the following output

# ifconfig -i eth0
eth0      Link encap:Ethernet  HWaddr D1:AA:42:11:22:33
          inet addr:10.1.2.3  Bcast:10.1.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2062 errors:0 dropped:1 overruns:0 frame:0
          TX packets:237 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:161416  TX bytes:77392

ifconfig -V
ifconfig (GNU inetutils) 1.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Marcus Brinkmann.

Note that there's no IPv6 address in the ifconfig command output? I know that IPv6 is working because I can use the new ip addr command from the "iproute2" suite to show me the active IPv6 addresses on the device. I can also ping6 to the local loopback interface address (::1) and I can ping6 from the device to a remote IPv6 address. 

You need to go ahead and install the version of ifconfig that comes with the net-tools suite as seen in Beyond LFS at

http://www.linuxfromscratch.org/blfs/view/svn/basicnet/net-tools.html

You'll probably have to install the net-tools suite any way to get the important command netstat which can be used to see what ports are open on your system.

When you go to follow the instructions to compile net-tools as seen at the link above DO NOT apply the remove_dups patch that they suggest. That will stop you from building the IPv6 capable version of ifconfig. It's up to you if you want to use the hostname tool from net-tools or keep the old one. I can't see much difference. Neither of them displays an IPv6 address. 

In addition when you run the "make config" command which asks you questions about what features you want, you must say no to the following features

DECnet protocol family (HAVE_AFDECnet)
STRIP (Metricom radio) support (HAVE_HWSTRIP)
Token ring (generic) support (HAVE_HWTR)

I admit, it is a little grating not to have DECnet or Token ring support but if I am magically transported back to 1987 I'll worry about it then. 

Back to the Future IV was all ready to film. It was about Marty needing
to go back to the past to get some DECnet drivers to install on his modern
day Linux system. For some reason the movie couldn't secure financing.

After building net-tools I backed up the original inetutils version of the ifconfig and hostname executables and deleted the old inetutils version of the ifconfig man page. I used the following commands as root

cp /bin/hostname /bin/hostname.inetutils
cp /sbin/ifconfig /sbin/ifconfig.inetutils
rm /usr/share/man/man1/ifconfig.1

Finally I ran make install to install the newer and better versions of both tools. It works beautifully now as per the output below (Note that the command syntax is a little different, but not significantly)

ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 10.1.2.3  netmask 255.255.255.0  broadcast 10.1.2.255
        inet6 fe80::d3aa:42ff:fe11:2233  prefixlen 64  scopeid 0x20<link>
        inet6 200a:111b:222c:333d:d3aa:42ff:fe11:2233  prefixlen 64  scopeid 0x0<global>
        ether d1:aa:42:11:22:33  txqueuelen 1000  (Ethernet)
        RX packets 2184  bytes 171492 (167.4 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 254  bytes 78754 (76.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# ifconfig -V

net-tools 1.60

ifconfig 1.42 (2001-04-13)

P.S. If you really do want DECnet support then you can try to install libdnet as seen at 

http://libdnet.sourceforge.net/

Note that it hasn't been updated since 2005 so I have no idea if it will work or not. 

As for Token Ring and STRIP support.....if you actually manage to get one of those WORKING, and I mean not just compiled but PHYSICALLY WORKING BETWEEN DEVICES using a Raspberry Pi then I will send you MONEY to tell me what hardware and setup you are using because that would be AWESOME!!

Token Ring was obviously superior to Ethernet. The world would
have been a better place if Token Ring won the LAN wars.

No comments: