天天看點

vnc/route/ifconfig 配置

重新開機網卡的方法:

1 network

利用root帳戶

# service network restart

#############################################################################

路由配置

1. 檢視

route -n

2. 添加

route add -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1

3. 删除

route del -net 9.123.0.0 netmask 255.255.0.0 gw 9.123.0.1

vncpassword 修改密碼

vncserver 預設監聽接口 5801、5901、6001

vnc/route/ifconfig 配置

ifconfig eth0 192.168.0.1 netmask 255.255.255.0

修改DNS server:

vi /etc/resolv.conf

修改預設if ip

vi /etc/sysconfig/network-scripts/ifcfg-eth2

根據檔案ifcfg-eth0打開指令及各項資訊如下:

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0#網卡裝置名稱 

ONBOOT=yes#啟動時是否激活 yes | no

BOOTPROTO=static#協定類型 dhcp bootp none

IPADDR=192.168.1.90#網絡IP位址

NETMASK=255.255.255.0#網絡子網位址

GATEWAY=192.168.1.1#網關位址

BROADCAST=192.168.1.255#廣播位址

HWADDR=00:0C:29:FE:1A:09#網卡MAC位址

TYPE=Ethernet#網卡類型為以太網

然後重新開機生效 service network restart

在linux下永久儲存路由表的寫法

一、RedHat Linux

在/etc/rc.d/rc.local檔案中添加。

/etc/rc.d/rc.local格式如下:

#!/bin/sh

#

# This script will be executed *after* all the other init scripts.

# You can put your own initialization stuff in here if you don't

# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

在/etc/rc.d/rc.local檔案最後按下面格式添加路由:

route add –host 180.200.3.170 gw 10.200.6.201 dev eth0

route add –net 180.200.0.0 netmask 255.255.0.0 gw 10.200.6.201 dev eth0

說明:route add:指令關鍵字,表示增加路由,若要删除路由,則為route del;

      -host/-net:表示路由目标是主機還是網段;

      netmask:表示路由目标為網段時才會使用到,表示路由目标網段的子網路遮罩;

繼續閱讀