I just wanted to set up a static IP address for a fedora 19 machine in my LAN. I'm used to /etc/network/interfaces
from debian but that file doesn't exist here.
After googling around a little bit, I found a small tutorial that tells one to disable NetworkManager via systemctl and enable network. After that one could configure the static IP address in a file called /etc/sysconfig/network-scripts/ifcfg-*interfacename*
.
Here is my first problem: I found a file with the MAC address of my interface as displayed by ifconfig
but the name after ifcfg- doesn't match the name from ifconfig. Why is that like this?
My second problem is about using NetworkManager.service or network.service. I read in a Forum, that network.service is still included for compatibility reasons and may be excluded soon. If network.service will soon be replaced by NetworkManager.service, shouldn't I choose NetworkManager.service to configure my network interfaces? If yes, how do I do that with NetworkManager from a shell?
Edit:
Here are the outputs requested:
[root@bitch /]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 97 bytes 12042 (11.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 97 bytes 12042 (11.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
p3p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.178.11 netmask 255.255.255.0 broadcast 192.168.178.255
inet6 fe80::214:85ff:febc:1c63 prefixlen 64 scopeid 0x20<link>
ether 00:14:85:bc:1c:63 txqueuelen 1000 (Ethernet)
RX packets 134347 bytes 169988336 (162.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 78199 bytes 6595669 (6.2 MiB)
TX errors 0 dropped 0 overruns 1 carrier 0 collisions 0
[root@bitch /]# ls -l /etc/sysconfig/network-scripts/
total 200
-rw-r--r--. 1 root root 437 Sep 15 02:05 ifcfg-enp2s5
-rw-r--r--. 1 root root 254 May 31 09:49 ifcfg-lo
lrwxrwxrwx. 1 root root 24 Jun 27 19:12 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root 627 May 31 09:49 ifdown-bnep
-rwxr-xr-x. 1 root root 5553 May 31 09:49 ifdown-eth
-rwxr-xr-x. 1 root root 781 May 31 09:49 ifdown-ippp
-rwxr-xr-x. 1 root root 4141 May 31 09:49 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 Jun 27 19:12 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 1642 May 31 09:49 ifdown-post
-rwxr-xr-x. 1 root root 1068 May 31 09:49 ifdown-ppp
-rwxr-xr-x. 1 root root 837 May 31 09:49 ifdown-routes
-rwxr-xr-x. 1 root root 1444 May 31 09:49 ifdown-sit
-rwxr-xr-x. 1 root root 1462 May 31 09:49 ifdown-tunnel
lrwxrwxrwx. 1 root root 22 Jun 27 19:12 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12445 May 31 09:49 ifup-aliases
-rwxr-xr-x. 1 root root 859 May 31 09:49 ifup-bnep
-rwxr-xr-x. 1 root root 10234 May 31 09:49 ifup-eth
-rwxr-xr-x. 1 root root 12033 May 31 09:49 ifup-ippp
-rwxr-xr-x. 1 root root 10437 May 31 09:49 ifup-ipv6
-rwxr-xr-x. 1 root root 804 May 31 09:49 ifup-ipx
lrwxrwxrwx. 1 root root 9 Jun 27 19:12 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 642 May 31 09:49 ifup-plip
-rwxr-xr-x. 1 root root 1043 May 31 09:49 ifup-plusb
-rwxr-xr-x. 1 root root 2609 May 31 09:49 ifup-post
-rwxr-xr-x. 1 root root 4154 May 31 09:49 ifup-ppp
-rwxr-xr-x. 1 root root 1925 May 31 09:49 ifup-routes
-rwxr-xr-x. 1 root root 3268 May 31 09:49 ifup-sit
-rwxr-xr-x. 1 root root 2607 May 31 09:49 ifup-tunnel
-rwxr-xr-x. 1 root root 3775 May 31 09:49 ifup-wireless
-rwxr-xr-x. 1 root root 4623 May 31 09:49 init.ipv6-global
-rw-r--r--. 1 root root 13836 May 31 09:49 network-functions
-rw-r--r--. 1 root root 26134 May 31 09:49 network-functions-ipv6
Content of /etc/sysconfig/network-scripts/ifcfg-enp2s5:
PEERROUTES="yes"
IPV6INIT="yes"
NAME="enp2s5"
IPV6_PEERDNS="yes"
DEFROUTE="yes"
UUID="7622e20e-3f2a-4b5c-83d8-f4f6e22ed7ec"
PEERDNS="yes"
IPV4_FAILURE_FATAL="no"
HWADDR="00:14:85:BC:1C:63"
BOOTPROTO="static"
IPV6_DEFROUTE="yes"
IPV6_AUTOCONF="yes"
IPV6_FAILURE_FATAL="no"
TYPE="Ethernet"
ONBOOT="yes"
IPV6_PEERROUTES="yes"
IPADDR=192.168.178.11
NETMASK=255.255.255.0
BROADCAST=192.168.178.255
NETWORK=192.168.178.0
GATEWAY=192.168.178.1
Grepping dmesg for udevd:
[root@bitch network-scripts]# dmesg | grep udevd
[ 0.788381] systemd-udevd[97]: starting version 204
[ 2.457296] systemd-udevd[322]: starting version 204
[ 3.110272] systemd-udevd[329]: renamed network interface eth0 to p3p1
ls /etc/sysconfig/network-scripts
2)ifconfig
p3p1
is configured as an alias, andenp2s5
is the real name. What about the output fromgrep -e "NAME=\|HWADDR=" /etc/sysconfig/network-scripts/ifcfg-enp2s5
? Is the value ofNAME=
equal toenp2s5
orp3p1
?DEVICE
instead ofNAME
...