CentOS 修改IP地址, DNS, 网关
一、CentOS 修改IP地址
修改对应网卡的IP地址的配置文件
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改以下内容
BOOTPROTO=static #设置网卡获得ip地址的方式,可能的选项为static,dhcp或bootp,分别对应静态指定的 ip地址,通过dhcp协议获得的ip地址,通过bootp协议获得的ip地址
BROADCAST=192.168.0.255 #对应的子网广播地址
HWADDR=00:07:E9:05:E8:B4 #对应的网卡物理地址
IPADDR=12.168.1.2 #如果设置网卡获得 ip地址的方式为静态指定,此字段就指定了网卡对应的ip地址
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0 #网卡对应的网络掩码
NETWORK=192.168.1.0 #网卡对应的网络地址
ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备
二、CentOS 修改网关
修改对应网卡的网关的配置文件
[[email protected]]# vi /etc/sysconfig/network
修改以下内容
NETWORKING=yes(表示系统是否使用网络,一般设置为yes。如果设为no,则不能使用网络,而且很多系统服务程序将无法启动)
HOSTNAME=centos(设置本机的主机名,这里设置的主机名要和/etc/hosts中设置的主机名对应)
GATEWAY=192.168.1.1(设置本机连接的网关的IP地址。例如,网关为10.0.0.2)
三、CentOS 修改DNS
修改对应网卡的DNS的配置文件
# vi /etc/resolv.conf
修改以下内容
nameserver 8.8.4.4 #google域名服务器
四、重新启动网络配置
# service network restart
或
# /etc/init.d/network restart
修改 IP 地址
即时生效:
# ifconfig eth0 192.168.0.2 netmask 255.255.255.0
启动生效:
修改 /etc/sysconfig/network-scripts/ifcfg-eth0
修改网关 Default Gateway
即时生效:
# route add default gw 192.168.0.1 dev eth0
启动生效:
修改 /etc/sysconfig/network
修改 DNS
修改/etc/resolv.conf
修改后可即时生效,启动同样有效
修改 host name
即时生效:
# hostname centos1
启动生效:
修改/etc/sysconfig/network
Incoming search terms:
- centos dns
- centos ip
- centos 修改ip
- centos 改ip
- centos 修改dns
- centos ip地址
- centOS 设置DNS
- centos dns 设置
- centos 网关
- centos修改ip
- centos 修改ip地址
- centOS 更改ip
- centos设置dns
- centos 改ip地址
- centos dns 修改
- sentos修改ip
- centos gateway设置
- centos 7 修改ip
- centos 修改dns地址
- centos 更改dns
- centos 改变ip 失效
- centos修改DNS
- centos修改dns地址
- 只有IP地址和网关如何改IP地址
- centos改ip
- 修改国外网关
- centos在哪改DNS
- centos修改ip地址
- centos7 修改dns
- cenos 修改ip
- centos 7修改DNS
- centos 更换ip
- centos 7 网卡 配置IP
- centos dns配置
- cent 7 修改IP
- centos ifcfg dns
- centos7 gateway设置
- centos中的ip地址是10.0.2.15
- centos 改 dns
- centos 配置网关
- centos 更改 dns
- centos network dns
- centos更改DNS
- centos 7 default gateway
- centos改dns
- centos 7 修改 dns
- centos修改网关
- centos中ip为10.0.2.15正常吗
- centos改IP地址
- 修改centos6.9 ip
- centos怎么删IP
- centos删ip
- centos 7 getway dns
- centos7设置ip地址网关怎么修改
- centos 修改 dns
- 更改centos IP地址
- centos7 gateway dns
- centos 查看网关 dns
- centos gateway
- centos 7 更改IP
- cenos 设置 gateway
- centos ip 修改
- centos 6.9 ip config
- CentOS6.9 中修改IP
- centos 7 修改 IP
- centos设置dns地址
- ip dns
- centos 7 更改dns
- 修改centos dns
- centos查询dns地址
- CentO修改DNS
- centos 7 修改网关
- centos 7 gateway
- 修改 centos 固定ip
- 修改ip地址 centos
- centos ip address config
- Centos 7 改ip地址
- centos ip设置
- centos如何改IP
- centos设置IP地址
- cenOS的gateway
- centeros 网关
- centos 改 IP
- centos 7 改ip
- CentOS7修改DNS
- centos 7 修改IP地址
- centos 7 修改dns
- centos 修改 ip 地址
- centos 6 更改IP
- centos 7 修改ip 地址
- centos ip a
- center os修改IP
- cenos如何修改ip
- centos6.9dns
- centos怎么修改IP地址
- environmentauu
- CENTOS更改IP
- 修改cenos ip
- stagebem
- withoutx9g
- metp81
- centos修改服务器ip地址
- problemg6w
- quieti1m
- habit34v
- northjyk
- constructionynm
- oppositeiiz
- railroad1tt
- heldf3u
Tags: centos, dns, Default Gateway, host name, 网关