On 12/21/2016 04:10 AM, François Patte wrote:
Bonjour,
I want to set a static IP adress for a laptop on my local network. So I
wrote a file
/etc/sysconfig/network-scripts/ifcfg-wlp3s0
like this:
DEVICE=wlp3s0
HWADDR=c4:d9:87:a6:67:33
TYPE=Wireless
BOOTPROTO=none
ONBOOT=yes
USERCTL=yes
IPADDR=192.168.1.29
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
MODE=Managed
ESSID=Meenakshi
DNS1=192.168.1.1
But it seems that, in fact, dhcp protocole is still in use as I can read
in the boot log:
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> (wlp3s0):
supplicant interface state: associating -> 4-wa
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> (wlp3s0):
supplicant interface state: 4-way handshake ->
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> (wlp3s0):
Activation: (wifi) Stage 2 of 5 (Device Configu
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> (wlp3s0):
device state change: config -> ip-config (reaso
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> Activation
(wlp3s0) Beginning DHCPv4 transaction (timeout
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> dhclient
started with pid 1433
déc. 21 08:19:19 berrichon dhclient[1433]: DHCPREQUEST on wlp3s0 to
255.255.255.255 port 67 (xid=0x76518119)
déc. 21 08:19:19 berrichon dhclient[1433]: DHCPACK from 192.168.1.1
(xid=0x76518119)
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> address
192.168.1.29
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> plen 24
(255.255.255.0)
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> gateway
192.168.1.1
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> server
identifier 192.168.1.1
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> lease time 86400
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> nameserver
'192.168.1.1'
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> nameserver
'192.168.1.1'
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> domain name
'home'
déc. 21 08:19:19 berrichon NetworkManager[1028]: <info> (wlp3s0):
DHCPv4 state changed unknown -> bound
You're probably using NetworkManager (the default in Fedora for quite
a while), not the classic netscripts mechanism. You didn't say which
desktop you're using, but use the appropriate NetworkManager applet to
make your changes (e.g. change from DHCP to fixed IP). This can usually
be found in the your desktop's start menu, somewhere under the
"Settings" area (on Xfce, "Applications menu->Settings->Network
Connections" for instance).
If you wish to revert to using the netscript mechanism, then you need
to (as the root user):
systemctl stop NetworkManager.service
systemctl start network.service
If you want netscripts to be the default in the future (e.g. survive
reboots), then:
systemctl mask NetworkManager.service
systemctl unmask network.service
systemctl enable network.service
The first line disables NetworkManager permanently, the last two lines
enable netscripts in its place. To revert back to NetworkManager being
the default:
systemctl mask network.service
systemctl unmask NetworkManager.service
systemctl enable NetworkManager.service
(NOTE: The "enable" may not be necessary..."unmask" may be enough.
This
is one of those areas where the documentation on systemd/systemctl
sucks.)
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital ricks(a)alldigital.com -
- AIM/Skype: therps2 ICQ: 226437340 Yahoo: origrps2 -
- -
- The Navy's a bunch of wimps! MY job's an adventure! -
----------------------------------------------------------------------