Friday, April 4, 2014

How to configure static IP on CentOS

https://gist.github.com/fernandoaleman/2172388
## Configure eth0 # # vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" NM_CONTROLLED="yes" ONBOOT=yes HWADDR=A4:BA:DB:37:F1:04 TYPE=Ethernet BOOTPROTO=static NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 IPADDR=192.168.1.44 NETMASK=255.255.255.0 PREFIX=24 DNS1=208.67.222.222 DNS2=208.67.220.220 DNS3=208.67.222.220 HWADDR=00:24:7E:6D:C0:FB GATEWAY=192.168.1.1 ## Configure Default Gateway # # vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=david-centos6 GATEWAY=192.168.1.1 ## Restart Network Interface # /etc/init.d/network restart ## Configure DNS Server # # vi /etc/resolv.conf nameserver 8.8.8.8 # Replace with your nameserver ip nameserver 192.168.1.1 # Replace with your nameserver ip
Note: don't forget to modify /etc/hosts by adding a new entry for 192.168.1.44 and remove 127.0.0.1 (because 127.0.0.1 will result in Spark Master refuse the connection request from Spark Worker)

No comments: