文章目录
  1. 1. Fedora 20: Setting a static IP address - Daniel Gibbs
  2. 2. Disable Network Manager
  3. 3. Set the Static Address
  4. 4. Apply the Settings
  5. 5. Configure DNS

Fedora 20: Setting a static IP address - Daniel Gibbs

linux fedora 20 设置静态IP地址

Disable Network Manager

  1. First stop and disable the gnome network manager from running on boot.
systemctl stop NetworkManagerservice
systemctl disable NetworkManagerservice
  1. Now start and enable the network service to run on boot.
systemctl restart networkservice
systemctl enable networkservice

Set the Static Address

  1. Check which interface(s) you want to set as static.
root@server  ifconfig
em1 flags192.1681.148 netmask 255.255255.0 broadcast 192.1681.255
inet6 fe80dd4c prefixlen  scopeid  ether d8 txqueuelen Ethernet
RX packets  bytes 90374
RX errors  dropped  overruns  frame 
TX packets  bytes 130252127.1
TX errors  dropped  overruns  carrier  collisions 
device interrupt  flags73mtu16436127.0 netmask 255.0
inet6  prefixlen  scopeid 
loop txqueuelen LocalLoopback
RX packets  bytes 
RX errors  dropped  overruns  frame 
TX packets  bytes 
TX errors  dropped  overruns  carrier  collisions 
  1. Next edit the config file for the required interface.
sysconfignetworkscriptsifcfg
  1. Edit the config file to look similar to the following.

Change the BOOTPROTO from “dhcp” to “static”. Also adding IPADDR, NETMASK, BROADCAST and NETWORK variables and make sure ONBOOT is set to yes.

"e88f1292-1f87-4576-97aa-bb8b2be34bd3"
NM_CONTROLLED"yes"
HWADDR"D8:D3:85:AE:DD:4C"
BOOTPROTO"static"
DEVICE"em1"
ONBOOT"yes"
IPADDR192.168
NETMASK255.255255.0
BROADCAST192.1681.255
NETWORK192.168
GATEWAY192.168

Apply the Settings

Restart the network service to apply the settings.

systemctl restart networkservice

Configure DNS

Make sure the correct DNS servers are configured to allow Fedora to resolve domains.

resolv
nameserver 192.168
nameserver 
![share-knowledge.png](/images/notes/Fedora-20_-Setting-a-static-IP-address-Daniel-Gibbs/share-knowledge.png)
文章目录
  1. 1. Fedora 20: Setting a static IP address - Daniel Gibbs
  2. 2. Disable Network Manager
  3. 3. Set the Static Address
  4. 4. Apply the Settings
  5. 5. Configure DNS