vim /etc/sysconfig/network-scripts/ifcfg-eth0(依網卡變更檔名)
DEVICE=eth0
BROADCAST=192.168.1.255
HWADDR=XX:XX:XX:XX:XX:XX
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
GATEWAY=192.168.1.254
TYPE=Ethernet
或直接執行
SETUP
DEVICE=eth0
BROADCAST=192.168.1.255
HWADDR=XX:XX:XX:XX:XX:XX
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
GATEWAY=192.168.1.254
TYPE=Ethernet
或直接執行
SETUP
2.DNS 設定:
vim /etc/resolv.conf
nameserver 168.95.1.1
nameserver 168.95.192.1
nameserver 168.95.1.1
nameserver 168.95.192.1
3.設定多重IP
/sbin/ip ad ad x.x.x.x/24 dev eth0
/sbin/ip ad ad (增加的IP)/(遮罩) dev (設定的網卡)
例:
/sbin/ip ad ad 192.168.1.2/24 dev eth0
/sbin/ip ad ad (增加的IP)/(遮罩) dev (設定的網卡)
例:
/sbin/ip ad ad 192.168.1.2/24 dev eth0
4.設定路由
/sbin/ip ro ad x.x.x.x/24 via x.x.x.x
/sbin/ip ro ad (目的地的網段) via (轉送的路由器位址)
例:
/sbin/ip ro ad 192.168.2.0/24 via 192.168.1.254
/sbin/ip ro ad (目的地的網段) via (轉送的路由器位址)
例:
/sbin/ip ro ad 192.168.2.0/24 via 192.168.1.254
5.設定HOST
vim /etc/hosts
127.0.0.1 centos.linux.com.tw msg localhost.localdomain localhost
127.0.0.1 centos.linux.com.tw msg localhost.localdomain localhost
0 意見:
張貼留言