1、臨時IP配置 # ifconfig eth0 192.168.110.118 netmask 255.255.255.0 gateway 192.168.110.2 up # ifconfig eth0 192.168.110.118/24 up # ifconfig eth0:1 192.16 ...
1、臨時IP配置 # ifconfig eth0 192.168.110.118 netmask 255.255.255.0 gateway 192.168.110.2 up # ifconfig eth0 192.168.110.118/24 up # ifconfig eth0:1 192.168.110.118/24 up 指定子介面 添加預設網關: route add default gw 192.168.110.2 2、永久IP配置 [root@natsha ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:0C:29:DD:DF:FF 【網卡的MAC地址】 TYPE=Ethernet UUID=37e7cb55-0428-4fac-8ddd-3b96a2043578【網卡的UUID】 ONBOOT=yes【設置開機啟動】 BOOTPROTO=static【靜態IP地址】 IPADDR=192.168.130.119 NETMASK=255.255.255.0 GATEWAY=192.168.130.2 DNS1=114.114.114.114【設置DNS】 [root@natsha ~]# 3、配置靜態路由 查看路由表

Metric | 路由距離,到達指定網路所需的中轉數(linux 內核中沒有使用) |
Ref | 路由項引用次數(linux 內核中沒有使用) |
Use | 此路由項被路由軟體查找的次數 |
.png)