linux下配置IP位址

2021-05-01 04:12:03 字數 587 閱讀 6662

示例環境:

os: fc2

nic: eth0

host name: fc2

ip: 192.168.0.20/24

default gateway: 192.168.0.254

修改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位址

root localhost network scripts pwd etc sysconfig network scripts root localhost network scripts ls ifcfg eth0 ifdown bnep ifdown post ifup ifup ipsec ...

Linux下IP位址配置方法

linux下ip位址配置可分為4種配置方法 1.ifconfig命令臨時配置ip位址 2.setup工具永久配置ip位址 3.修改網路配置檔案 4.圖形介面配置ip位址 下面具體介紹一下各種配置方法 一 ifconfig命令配置 此命令還可以檢視網路狀態 只能臨時配置ip位址,一旦系統重啟就會重置i...

linux下ip位址認證多IP配置

為乙個網絡卡新增乙個ip 1 進入 etc sysconfig network scripts 目錄下,cd etc sysconfig network scripts 2 複製乙份ip 模板到該目錄下 這裡以 ifcfg eth0 為模板cp ifcfg eth0 ifcfg eth0 100,將...