interface_config
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
interface_config [2020/01/23 10:42] – created walkeradmin | interface_config [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Interface | + | ====== Interface |
- | <color darkorange> | + | <color darkorange> |
---- | ---- | ||
Line 6: | Line 6: | ||
\\ | \\ | ||
\\ | \\ | ||
- | When looking at the RX1 GUI, under servers we can see the Locking code for license generation. | + | When using the M1 chassis, it should have been installed using the official .ISO, so this is applicable to both RX1 and MKSP installation. |
\\ | \\ | ||
+ | \\ | ||
+ | Even though the interface configuration may look okay, there is an issue with the way the interfaces are installed, to remedy this you can run a small script that will recreate all of the configuration files. | ||
+ | \\ | ||
+ | \\ | ||
+ | The script <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | To use the script, copy it to a folder that you have rights to use (/ | ||
+ | chmod +x update_network_devices.sh | ||
+ | \\ | ||
+ | Now run the file using the following command: | ||
+ | ./ | ||
+ | \\ | ||
+ | The script will create new ifcfg-ethx files depending on installed hardware (what NIC cards you have installed). | ||
+ | \\ | ||
+ | \\ | ||
+ | Navigate to / | ||
+ | sudo / | ||
+ | \\ | ||
+ | Now add all of your IP Details. | ||
+ | \\ | ||
+ | \\ | ||
+ | Alternatively you can configure the interfaces via nmtui or the front panel (might have to reboot to use the front panel) | ||
+ | \\ | ||
+ | \\ | ||
+ | ===== Interface Script ===== | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | |||
+ | # Script to assign names and hardware IDs to ifcfg-net* files as well as turn on | ||
+ | # consistent NIC naming. This resolves the issue of NIC ports swapping around | ||
+ | # due to boot-time race conditions. It should be run manually once after upgrade | ||
+ | # if you have multiple NICs. However it will delete all network configuration | ||
+ | # and rename NICs to be net0, net1, etc, which is not supported by all software. | ||
+ | |||
+ | echo " | ||
+ | |||
+ | # recognised NICs # from https:// | ||
+ | DEVICE_CODE_ONBOARD=" | ||
+ | DEVICE_CODE_10G_CARD=" | ||
+ | # Intel Corporation - Ethernet Controller X710 for 10GbE SFP+ | ||
+ | # Intel Corporation - Ethernet Controller 10-Gigabit X540-AT2 | ||
+ | DEVICE_CODE_1G_CARD=" | ||
+ | |||
+ | |||
+ | TMP_FILE="/ | ||
+ | FILE_ETHX_TEMPLATE=/ | ||
+ | GRUB_FILE="/ | ||
+ | |||
+ | function create_ifcfg() { | ||
+ | touch $1 | ||
+ | cat > $1 << " | ||
+ | TYPE=Ethernet | ||
+ | BOOTPROTO=" | ||
+ | ONBOOT=yes | ||
+ | PERSISTENT_DHCLIENT=yes | ||
+ | IPV6INIT=no | ||
+ | PEERNTP=no | ||
+ | EOF | ||
+ | chmod 755 $1 | ||
+ | } | ||
+ | |||
+ | function detect_nic_card() { | ||
+ | device_code=$1 | ||
+ | lspci_id=$(lspci -nn | egrep " | ||
+ | for i in ${lspci_id}; | ||
+ | do | ||
+ | mac_addr=$(dmesg | fgrep $i | egrep -o " | ||
+ | echo " | ||
+ | net_index=$(( $net_index + 1 )) | ||
+ | done | ||
+ | } | ||
+ | |||
+ | # Check we have root privledges | ||
+ | if [[ $EUID != 0 ]]; then | ||
+ | echo "root privileges needed, please re-run with sudo" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | # Delete existing ifcfg files | ||
+ | mv ${FILE_ETHX_TEMPLATE}lo / | ||
+ | rm -Rf ${FILE_ETHX_TEMPLATE}* | ||
+ | mv / | ||
+ | |||
+ | rm -rf $TMP_FILE | ||
+ | touch $TMP_FILE | ||
+ | |||
+ | # Create entries in nic order file | ||
+ | net_index=0 | ||
+ | detect_nic_card $DEVICE_CODE_ONBOARD | ||
+ | detect_nic_card $DEVICE_CODE_10G_CARD | ||
+ | detect_nic_card $DEVICE_CODE_1G_CARD | ||
+ | |||
+ | #iterate through nic order file and update ifcfg files | ||
+ | echo "Hard coding ethernet devices as follows:" | ||
+ | while read line; do | ||
+ | |||
+ | echo $line | ||
+ | |||
+ | name=`echo " | ||
+ | mac=`echo " | ||
+ | ifcfg_file=${FILE_ETHX_TEMPLATE}$name | ||
+ | |||
+ | # Check if an ifcfg file already exists for this interface and if not, create it | ||
+ | if [ ! -f $ifcfg_file ]; then | ||
+ | create_ifcfg ${ifcfg_file} | ||
+ | fi | ||
+ | |||
+ | # Remove entries that we are going to set from the ifcfg file | ||
+ | sed -i '/ | ||
+ | sed -i '/ | ||
+ | sed -i '/ | ||
+ | sed -i '/ | ||
+ | sed -i '/ | ||
+ | sed -i '/ | ||
+ | |||
+ | # Add fields to ifcfg file | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | |||
+ | done < | ||
+ | |||
+ | # Finally, enable consistent naming which ensures ifcfg files are used | ||
+ | sed -i ' | ||
+ | grub2-mkconfig -o $(readlink -e / | ||
+ | |||
+ | echo " | ||
+ | </ |
interface_config.1579776144.txt.gz · Last modified: 2023/03/09 22:35 (external edit)