From bd2585e3f56f2ec41c2564bba6a3a075ab5e77ea Mon Sep 17 00:00:00 2001 From: Glen Rundblom Date: Nov 11 2015 22:27:55 +0000 Subject: Added content about manual IP assignment in the command line in the Networking.xml file, publican fails to build, but I think that is because I am trying under F23, --- diff --git a/en-US/Networking.xml b/en-US/Networking.xml index b38cbff..c25b6b0 100644 --- a/en-US/Networking.xml +++ b/en-US/Networking.xml @@ -8,14 +8,125 @@
DHCP VS Static IP assignment - DHCP: Dynamic Host protocol: The DHCP server assigns an IP address to the computer. This can be random within the DHCP server's address pool. + DHCP: Dynamic Host protocol: The DHCP server assigns an IP address to the computer. This can be random within the DHCP server's address pool. Or it can be a reservation. Having a reservation for a client can effectively mimic a static IP. This will give the client the same IP address over and over, without having to manually configure the IP manually on the host. - The advantage to this is less manual configuration on the host + The advantage to this is less manual configuration on the host. + + While having a DHCP reservation mimics a static IP, you will be reliant on the DHCP service to be running for your host to keep getting the same IP address. + - Static: This way is when you manually assign an IP address into the computer. You may need to do this on a network that has no DHCP server, or the DHCP server will not allow you to have reservations for your computer. - Manually assigning a static IP address has the benifit of making some configurations easier. Especially when configuring a server because in server configuration files + Static: This way is when you manually assign an IP address into the computer. You may need to do this on a network that has no DHCP server, or the DHCP server will not allow you to have reservations for your computer. + Manually assigning a static IP address has the benefit of making some configurations easier. Especially when configuring a server because in server configuration files you can specify the IP address of the server, that you know will be the same every time. An example if configuring MySQL to answer on a specific IP address you have configured on the server. + + If you want to setup your machine with a static IP address there are a few items you need to know: + + + + + + The IP address you want to use + + + + + The sub-net mask of your network sub-net + + + + + The Gateway/Router IP of your sub-net + + + + + DNS servers you will want to use + + + + + Try to make the static address outside of the pool of addresses that the DHCP server assigns + + + +
+
+ How to set up a static IP assignment via the command line + + To setup manual an IP address manually, you must first find which network interface, or network card you will be assigning the IP + address to. + + + + Find_Your_Interface + + + list the contents of directory /etc/sysconfig/network-scripts: ls -l /etc/sysconfig/network-scripts + + + + + You should see items that start with ifcfg-INTERFACENAME, so usually it is ifcfg-eth0, sometimes it could be something like: ifcfg-enp1s0 + This is the interface file you will probably be editing + + + + + open the interface with your text editor of choice, sudo vim /etc/sysconfig/ifcfg-eth0 + + + + + edit the file with the information you have collected: + +HWADDR=AA:BB:CC:DD:AA:BB #Required +TYPE=Ethernet #Required +BOOTPROTO=static #Required +DEFROUTE=yes #Required +IPADDR=192.168.1.65 #Required +NETMASK=255.255.255.0 #Required +GATEWAY=192.168.1.1 #Required +IPV4_FAILURE_FATAL=no +IPV6INIT=no +IPV6_AUTOCONF=no +IPV6_DEFROUTE=no +IPV6_FAILURE_FATAL=no +NAME=eth0 +UUID= +ONBOOT=yes #Required +DNS1=8.8.8.8 #Required +DNS2=8.8.4.4 +PEERDNS=yes +PEERROUTES=yes +IPV6_PEERDNS=no +IPV6_PEERROUTES=no + + In this example, there is a lot of extra lines because this file was auto-created by the system. I marked + lines that are mandatory with #Required. + What is neat in the newer versions of Fedora, is you can set the DNS and Gateway per interface. Please do not have the #Required comments in your config file + + + + What is nice about specifying the gateway and DNS at the interface level instead of the system level is so you can have multiple interfaces on a computer + attached to different networks/routes. This is nice especially for a laptop when you want the wired interface to have a special configuration but have the wireless + as general DHCP that attaches to many different networks. + + + + + + Save the file + + + + + Now you need to restart network manager service sudo systemctl restart NetworkManager + + + + +