分类: IT技术
2013-04-07 09:20 
2330人阅读 
评论(1) 
收藏 
举报

To do that, just log on as root and change directory to /etc/sysconfig/network-scripts/ to view all available devices.

# cd /etc/sysconfig/network-scripts/

You need to edit following files:

  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

To edit/create first NIC file, type command:

# vi ifcfg-eth0

Append/modify as follows:

DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=192.168.0.10
NETMASK=255.255.255.0
ONBOOT=yes

Save and close the file.

After that, configure the default gateway (router IP) and hostname in /etc/sysconfig/network file:

# vi /etc/sysconfig/network

Append/modify configuration as follows:

NETWORKING=yes
HOSTNAME=techkaki
GATEWAY=192.168.0.1

Save and close the file. Restart networking by enter following command:

# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:

# vi /etc/resolv.conf

Setup DNS Server as follows:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:

$ ping 192.168.0.1

Linux CentOs6.4 静态IP 设置的更多相关文章

  1. CentOS6网卡静态IP设置

    CentOS网卡配置源文件如下:DEVICE=eth0HWADDR=00:0C:29:A8:67:46TYPE=EthernetUUID=4103d7a8-d073-4e93-ac68-e6f8496 ...

  2. 一张图教你弄清楚linux虚拟机的静态IP设置原理 VMnet8

  3. 1 weekend110的Linux带图形系统安装 + 网络配置 + 静态IP设置

    一.weekend110的Linux带图形系统安装 二.网络配置 明明是配置好的啊,只能说是域名出现问题了, 出现ping:unknow host www.baidu.com的问题解决 解决Ubunt ...

  4. Linux hostname设置,静态ip设置,hostname与静态ip相互映射

    1,hostname设置 永久设置: centos 7 下,切换到root 用户 vi /etc/hostname 输入要修改的hostname centos 6或者其他linux 系统,可能在/et ...

  5. ubuntu12.04静态ip设置问题

    由于linux知识不是学的很深,所以仅代表我自己的设置成功总结. 第一步是设置/etc/network/interfaces 增加静态ip设置 auto eth0iface eth0 inet sta ...

  6. Linux下的静态IP配置【weber出品】

    配置Linux下的静态IP地址 因为服务器的IP地址是固定的,不像我们自己家的笔记本的IP是动态的.所以我们要将这个地址给写成静态的. 直接编辑这个这个配置文件即可: vi /etc/sysconfi ...

  7. Centos 7 学习之静态IP设置

    原文链接:http://blog.csdn.net/johnnycode/article/details/40624403 本学习主要针对 Centos 7.0.1406 版本进行学习整理! 如果你使 ...

  8. Centos7静态ip设置(亲测有效)

    本文引自:https://www.cnblogs.com/toov5/p/10340395.html,特此鸣谢 最近想测试消息中间件等各类web集群相关技术,这就需要解决linux主机之间互联互通的若 ...

  9. VMware workstation --虚拟机静态ip设置

    背景介绍 我在本机win10上安装VMware workstation软件,新建两台centos7虚拟机,最近在配服务,每天虚拟机重启后,ip总会变,服务配置文件又要修改,很麻烦,便需要将其ip由dh ...

  10. Linux history时间用户ip设置

    Linux history时间用户ip设置        在使用linux服务器的时候发生一些不知道谁操作的问题,google一下说history命令可以查看到历史记录,用过之后发现还是不够详细,再g ...

随机推荐

  1. TCP和UDP可以使用同一个端口号吗?

    TCP和UDP可以使用同一个端口号吗? 首先说答案:可以.怎么理解呢? 我想这个问题要从计算机网络通信谈起,学过计算机网络的同学,可能都还记得7层或者4层网络模型,TCP/UDP属于其中的传输层协议, ...

  2. jenkins 钉钉机器人插件

    官方文档: https://jenkinsci.github.io/dingtalk-plugin/guide/getting-started.html#%E6%B3%A8%E6%84%8F 注意:系 ...

  3. Java面试必考题之线程的生命周期,结合源码,透彻讲解!

    写在开头 在前面的几篇博客里,我们学习了Java的多线程,包括线程的作用.创建方式.重要性等,那么今天我们就要正式踏入线程,去学习更加深层次的知识点了. 第一个需要学的就是线程的生命周期,也可以将之理 ...

  4. Openssl命令详解 - 密钥篇

    非对称算法密钥生成和公钥提取 # ecc算法 openssl ecparam -out pri.key -name prime256v1 -genkey #生成ec密钥,国密使用-name SM2 o ...

  5. Swing 使用 beautyeye_lnf.jar 美化

    Springboot整合Swing制作简单GUI客户端项目记录 https://blog.csdn.net/Youdmeng/article/details/106549991

  6. vitepress 发布到 gitee上的build命令 自动设置base

    docs.vitepress\config.js const argv = require('minimist')(process.argv.slice(2)) const build = argv. ...

  7. Spring 中不得不了解的姿势

    说明 本文非原创,我只是进行了整理以及做了一些改动,仅供学习,若需进行商业使用,请联系原作者 原作者:苏三 原文链接:苏三说技术:Spring系列 Spring IOC 本章节解读的流程为Spring ...

  8. 几个有用的svn命令

    1.检验authz文件是否合法;svnauthz-validate /root/.svn/webservice/conf/authz 2.杀死svn服务:killall svnserve 3.查看sv ...

  9. CMake 用法总结(转载)

    原文地址 什么是 CMake All problems in computer science can be solved by another level of indirection. David ...

  10. 【个人笔记】VirtualBox7+Debian11基础环境搭建

    本文主要是对在最新的VirtualBox7上搭建Debian11的笔记记录,方便后续个人回顾,同时搭配对配置的浅析. sudoers配置 非root用户想要使用sudo命令,需要两个条件: 系统安装了 ...