Skip to content

Instantly share code, notes, and snippets.

@adionditsak
Last active August 29, 2015 13:56
Show Gist options
  • Save adionditsak/8998245 to your computer and use it in GitHub Desktop.
Save adionditsak/8998245 to your computer and use it in GitHub Desktop.
A bit of eth0 and nw configuration for CentOS snippets - static ip
# eth0
$ vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
NAME="eth0"
IPADDR=ipaddress
NETMASK=255.255.255.0
-
# Gateway
$ vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=aarvik
GATEWAY=ipaddress
-
# Restart network
$ sudo service network restart
-
# Local DNS
$ vim /etc/resolv.conf
# Google DNS
nameserver 8.8.8.8
# Fallback at OpenDNS
nameserver 208.67.222.222
nameserver 208.67.220.220
@adionditsak
Copy link
Author

Test with $ route -n, $ ifconfig and ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment