Skip to content

Instantly share code, notes, and snippets.

@adionditsak
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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

For VirtualBox use:

$ vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=dhcp
NAME="eth0"

And set VirtualBox machine to use network bridge to your physical computer.

@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