linux_wiki:static_ip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:static_ip [2018/07/12 22:02]
billdozor
linux_wiki:static_ip [2019/05/25 23:50]
Line 1: Line 1:
-====== Static IP ====== 
- 
-**General Information** 
- 
-Configure static IP, Mask, Gateway, and DNS. 
- 
-**Checklist** 
-  * Distro(s): Debian or Enterprise Linux 
- 
-FIXME -> Add section for NetworkManager setup via nmcli and nmtui 
- 
----- 
- 
-===== Configure Static Network Info ===== 
- 
-==== Debian/Ubuntu Systems ==== 
-if possible, bring interface down first: ifdown eth0. 
- 
-  * Edit /etc/network/interfaces<code bash>vim /etc/network/interfaces</code> 
- 
-  * DHCP Setup Example (Default)<code bash>auto eth0 
-iface eth0 inet dhcp</code> 
- 
-  * Static Setup Example<code bash>auto eth0 
-iface eth0 inet static 
-  address 192.168.0.100 
-  netmask 255.255.255.0 
-  gateway 192.168.0.254 
-  dns-nameservers 8.8.8.8 8.8.4.4</code> 
- 
-  * Bring the interface up (if brought down at the start)<code bash>ifup eth0</code> 
- 
-  * Otherwise, restart to fix nameserver conflicts between dhclient and static.<code bash>shutdown -r now</code> 
- 
----- 
- 
-==== Redhat/CentOS Systems ==== 
- 
-  * Edit /etc/sysconfig/network-scripts/ifcfg-eth0<code bash>vim /etc/sysconfig/network-scripts/ifcfg-eth0</code> 
- 
-  * DHCP Setup Example (Default)<code bash>DEVICE=eth0 
-ONBOOT=no (change to yes to have DHCP start automatically) 
-NM_CONTROLLED=yes 
-BOOTPROTO=dhcp</code> 
- 
-  * Static Setup Example<code bash>DEVICE=eth0 
-ONBOOT=yes 
-NM_CONTROLLED=no 
-BOOTPROTO=static 
-IPADDR=192.168.0.101 
-NETMASK=255.255.255.0 
-GATEWAY=192.168.0.254</code> 
- 
-  * Edit /etc/resolv.conf<code bash>vim /etc/resolv.conf 
- 
-nameserver 8.8.8.8 
-nameserver 8.8.4.4</code> 
- 
-  * Restart network service<code bash>/etc/init.d/network restart</code> 
  
  • linux_wiki/static_ip.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)