Hello.
I have a bootable usb key.
I have installed 15.1 on it in a way where the usb key was the only computer drive.
I can boot from that usb key on any computer by accessing the bios during power up; then choose the usb key to boot on.
Every things is ok but I need help to auto configure network so that access to internet is enabled.
The current network configuration on the USB stick is wicked and perhaps is not the best choice.
[size=2]PREAMBLE
[/size]
I decide to name the network connection ‘eth0_usb’ for Ethernet and ‘wifi0_usb’ for Wifi.
That give the name ‘ifcfg-eth0_usb’ and ‘ifcfg-wifi0_usb’ for the configuration files.
The following configuration files contain the data that correspond to my wishes.
/etc/sysconfig/network/config
/etc/sysconfig/network/dhcp
/etc/sysconfig/network/ifcfg-eth0_usb
/etc/sysconfig/network/ifcfg-wifi0_usb
/etc/hostname
/etc/resolv.conf
/etc/sysctl.confdefinition overload
/etc/udev/rules.d/70-persistent-net.rules
After googleing I decide to add the following parameters to the kernel cmdline to help/prevent naming the card ( as far i have understood ;))
net.ifnames=0 biosdevname=0
What I have understood is that the file name of ‘/etc/sysconfig/network/icfg-<DEVICE_NAME>’ must meet <DEVICE_NAME> in ‘/etc/udev/rules.d/70-persistent-net.rules’ with the corresponding hardware address as :
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="12:34:56:78:9a:bc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="<DEVICE_NAME>"
Then I modify ‘/etc/udev/rules.d/70-persistent-net.rules’ to reflect different harware on 3 computers :
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device : lan device : COMPUTER1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="12:34:56:78:9a:bc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0_usb"
# PCI device : wlan device : COMPUTER1
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="34:56:78:9a:bc:12", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0_usb"
# PCI device : lan device : COMPUTER2
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="56:78:9a:bc:12:34", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0_usb"
# PCI device : wlan device : COMPUTER2
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="78:9a:bc:12:34:56", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0_usb"
# # # PCI device 0x8086:0x15a1 (e1000e)
# PCI device : lan device : COMPUTER3 - NO WIFI
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="9a:bc:12:34:56:78", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0_usb"
THE PROBLEMS
- That works only ounce to get connection to internet.
- The file ‘/etc/udev/rules.d/70-persistent-net.rules’ is modified by the system.
I did not get connection to internet
Ex 1 : some lines are merged, some lines deleted, some lines added
# You can modify it,as long as you keep each rule on a single
# line,and change only the value of the NAME= key.
# PCI device : lan device : COMPUTER1
# PCI device : wlan device : COMPUTER1
# PCI device : lan device : COMPUTER2
# PCI device : wlan device : COMPUTER2
# PCI device 0x8086:0x15a1 (e1000e) initial value : PCI device : lan device : COMPUTER3
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="56:78:9a:bc:12:34", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="eth0_usb"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="78:9a:bc:12:34:56", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wlan0_usb"
# PCI device 0x1969:0x10a1 (alx)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="9a:bc:12:34:56:78", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Ex 2 : Restarting with my initial config file and booting on the second computer :
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program,run by the persistent-net-generator.rules rules file.
#
# You can modify it,as long as you keep each rule on a single
# line,and change only the value of the NAME= key.
# PCI device 0x1969:0x1083 (atl1c)
# PCI device 0x168c:0x0032 (ath9k)
# PCI device 0x168c:0x0032 (ath9k)
# USB device 0x0b95:0x1790 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="ath9k", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="12:34:56:78:9a:bc", NAME="gvw_wifi0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="34:56:78:9a:bc:12", ATTR{dev_id}=="0x0", ATTR{type}=="1", ATTR{address}=="30:85:a9:28:16:f9", NAME="gvw_eth0"
# USB device 0x0b95:0x1790 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="**00:0e:c6:b9:7f:7a**", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="usb_eth0"
This address does not exists : 00:0e:c6:b9:7f:7a
- If I make an empty file '/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
the system update this file but I can connect to internet from this computeur but not from another one.
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1969:0x10a1 (alx)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0_usb"
# PCI device 0x168c:0x0034 (ath9k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="yy:yy:yy:yy:yy:yy", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0_usb"
THE CURRENT METHODE
Any way this methode does not work on an unknown computer because I will not know the hardware addresses.
THE QUESTION
How to auto configure the network during the boot up sequence on any computer.
Any help is welcome