Last active
August 29, 2015 13:56
-
-
Save adionditsak/8998245 to your computer and use it in GitHub Desktop.
A bit of eth0 and nw configuration for CentOS snippets - static ip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
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.