Updating Networking via setup Command

I am trying to add orange network via the setup command. The window opens and shows the available options.

I can select and option and it opens its configuration screen except for Networking. Upon selecting Networking an error screen appears.

Any ideas on where I should begin looking?

Thank you

on the console or via ssh run the command

ls -hal /var/ipfire/ethernet/

and see what it shows.

On my system I have

ls -hal /var/ipfire/ethernet/
total 20K
drwxr-xr-x  2 nobody nobody 4.0K Oct  8 11:45 .
drwxr-xr-x 52 root   root   4.0K Oct 25 18:04 ..
-rw-r--r--  1 nobody nobody    0 Feb  2  2017 aliases
-rw-r--r--  1 nobody nobody    0 Feb 20  2025 known_nics
-rw-r--r--  1 root   root    573 Oct  8 11:45 scanned_nics
-rw-r--r--  1 nobody nobody 1.2K Oct  8 11:46 settings
-rw-r--r--  1 nobody nobody  239 Jun 27 13:03 vlans
-rw-r--r--  1 nobody nobody    0 Feb  2  2017 wireless

The important bit is do you have the settings file present and if it is, does it have nobody:nobodyas the ownership.

That error message is saying that the file cannot be opened for reading, so either itr is not present or the ownership is wrong. It could also be the permissions but that usually is more of a problem when the file has ended up read only and so the file can not be opened for writing to but the step you are at is when the data needs to be read from the file.

Adolf,

The command returns

Ownership and permissions match your system.

They do but you also have settings.save and settings.save.1 that were created back in July this year.

These have not been created by IPFire and suggest to me that the contents of the settings file has maybe been manually edited or added to and that an incorrect change in contents could be preventing the setup code from being able to access the information from the file.

Can you show the contents of the settings file?

Also can you show a screenshot of your Network - Zone Configuration WUI page?

1 Like

A short walkthrough of the sources for setup shows, that the error is produced by syntax errors in the file /var/ipfire/ethernet/settings.

The program expects lines of the form (excerpt of my settings file)

RED_ADDRESS=0.0.0.0
GREEN_DEV=green0
BLUE_DESCRIPTION='"pci: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter"'
ORANGE_MACADDR=

There are no comments ‘# …’ possible!

Adolf and Bernhard,

I deleted the extra files. Below is a screenshot of the setting file contents and the Zone Configuration page. I have also included the contents of the scanned_nics file.

You should have kept the one that was original so that you could have reverted to it.

This shows that changes have been made manually to the settings file. As @bbitsch noted the use of # is a syntax error in that file for the setup code. This is why you shouldn’t edit the files manually. They are designed to be created via the WUI.

The simplest step first is to remove all those # lines in the settings file and try setup again.

If it still doesn’t work then I would suggest to restore your backup file. Hopefully you created a backup file in IPFire before starting the manual editing of the settings file.

The restore should then provide you with the last working settings file which should then work with the setup program.

1 Like

Adolf,

Removing the ‘#’ from the file worked as the solution.

Jack

As a result of this discussion we can state

  • There are two kinds of programs reading settings files: C code and Perl code
  • C programs use a function not accepting comments
  • Perl programs use a function that accepts comment lines ( starting with ‘#’ )
  • Usually you don’t know which flavour is used, therefore don’t use comments
  • Both kinds do write comment-less files; a read-modify-write transaction deletes comments

Thanks for the impulse to reread the sources. :slight_smile:

We could discuss a comment-friendly version of the read process. But I can’t imagine a solution to preserve any manual edited comments.