天天看点

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:表示路由目标为网段时才会使用到,表示路由目标网段的子网掩码;

继续阅读