在Linux作業系統下修改IP DNS和路由配置

2021-05-24 15:31:48 字數 992 閱讀 2197

ifconfig eth0 新ip

一、修改ip位址

[aeolus@db1 network-scripts]$ vi ifcfg-eth0

device=eth0

onboot=yes

bootproto=static

ipaddr=219.136.241.211

netmask=255.255.255.128

gateway=219.136.241.254

二、修改閘道器

vi /etc/sysconfig/network

networking=yes

hostname=aaron

gateway=192.168.1.1

三、修改dns

[aeolus@db1 etc]$ vi resolv.conf

nameserver 202.96.128.68

nameserver 219.136.241.206

四、重新啟動網路配置

/etc/init.d/network restart

修改ip位址

即時生效:

# ifconfig eth0 192.168.0.20 netmask 255.255.255.0

啟動生效:

修改/etc/sysconfig/network-scripts/ifcfg-eth0

修改default gateway

即時生效:

# route add default gw 192.168.0.254

啟動生效:

修改/etc/sysconfig/network-scripts/ifcfg-eth0

修改dns

修改/etc/resolv.conf

修改後可即時生效,啟動同樣有效

修改host name

即時生效:

# hostname fc2

啟動生效:

修改/etc/sysconfig/network

Linux作業系統修改ip

修改 etc sysconfig network scripts ifcfg eth0 device name 其中,name是物理裝置名。ipaddr addr,其中,addr是ip位址。netmask mask,其中,mask是網路掩碼值。network addr,其中addr是網路位址。bro...

在Linux作業系統下修改IP DNS和路由配置

ifconfig eth0 新ip ip ts ifcfg eth0,修改ip 一 修改 ip 位址 aeolus db1 network scr ip ts vi ifcfg eth0 device eth0 onboot yes bootproto static ip addr 219.136....

在Linux作業系統下修改IP DNS和路由配置

在linux作業系統下修改ip dns和路由配置 ifconfig eth0 新ip 一 修改ip位址 aeolus db1 network scripts vi ifcfg eth0 device eth0 onboot yes bootproto static ipaddr 219.136.24...