When I try to set static ip address of the usb to network connector device, the network device name is enp0s20f0u2u3,and i try to modify /etc/sysconfig/network-scripts/ifcfg-enp0s20f0u2u3,but there is no this file found, so a create a new file with this name , and add something as blow:
Then i do service NetworkManager restart command,after that i input the command ifconfig,the ip still not modified as 192.168.100.1 ?
the kernel version is Linux red.WS 5.6.13-300.fc32.x86_64 #1 SMP Thu May 14 22:51:37 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
But are you on an headless machine, I mean, aren’t you using a graphical interface?
However I’m not sure, but nowadays /etc/sysconfig/network-scripts is not the way to configure network interfaces. You should have a look to the command nmcli
Scripts are stored within /etc/sysconfig/network-scripts regardless of whether they are created with nmcli or by hand. If creating them by hand, and as long as the syntax is correct, they should function just fine.
Additionally, if a script is modified, it should be reloaded with:
$ sudo nmcli con load /etc/sysconfig/network-scripts/ifcfg-<name>
Or: $ sudo nmcli con reload ← This reloads all scripts.
Or, you could simply restart the NetworkManager service, which is what happened here.
When a system is booted, two things will take place with ifcfg scripts. The first is that NetworkManager (if installed and enabled) will try and bring whatever device online that it can. It does this by executing a nmcli con load on specific ifcfg scripts. The second is that /etc/init.d/network will dig through each ifcfg script, check to see if ONBOOT=yes exists and bring it up if NetworkManager hasn’t already.
In this post, it simply sounds like there may be some confusion about the GATEWAY and IPADDR options. The GATEWAY option simply designates which IP Address all traffic should be routed through for that specific interface and the IPADDR sets the IP Address of the specific interface.
I success do this command sudo nmcli con up enp0s20f0u2u3, after i do that the net device ip setted with 192.168.100.100.but why sudo service NetworkManager restart could not do this ??
Besides, I found a another issue, I both have wifi and the (usb to netcable) device , I use wifi to surfing on net, use the usb to netcable to debug the embeded device, but after do this command ,i could not surfing,when i do
From 192.168.100.200 icmp_seq=1 Destination Host Unreachable