Solaris 10 配置双网卡双网关出口

来源地址: http://www.ixdba.net/article/1d/271.html

经常有一些朋友问如何在Solaris 10配置双网,并设置两个网关出口,下面我就把Solaris 10 双网卡双网关的配置帖出来给大家参考一下。

一、环境描述

+-----------+          +-------------+
|      |          | Rourer1  |
|      | CE0:172.16.0.8→ | 172.16.0.1 | ------>172.16.0.0/16
|      |          +-------------+
| Solsris |
|      |          +-------------+
|       | CE1:192.168.0.8→| Rourer1  |
|      |          | 192.168.0.1 |------->互联网(0)
+-----+-----+          +-------------+

如上图所示,Solaris 10机器有CE0和CE1两张网卡,分配给CE0的IP地址为172.16.0.8/24 网关172.16.0.1访问172.16.0.0 255.255.0.0的网段;分配给CE1的ip地址为192.168.0.8/24 网关为192.168.0.1 访问互联网的资源。

二、Solaris 10 双网卡配置

2.1双网卡的IP地址配置

############修改/etc/hosts文 件#####################
# Internet host table
#
127.0.0.1       localhost      
172.16.0.8  intranet intranet.net     loghost
192.168.0.8 internet internet.net     loghost
# intranet计算机名对应IP为172.16.0.8
# internet计算机名对应IP为192.168.0.8
#/etc/hosts和/etc/inet/ipnodes文件相同
##################################################

 

##############修改/etc/inet/ipnodes文 件##################
# Internet host table
#
127.0.0.1       localhost      
172.16.0.8  intranet intranet.net     loghost
192.168.0.8 internet internet.net     loghost
# intranet计算机名对应IP为172.16.0.8
# internet计算机名对应IP为192.168.0.8
#/etc/hosts和/etc/inet/ipnodes文件相同
##################################################

 

###########修改/etc/hostname.ce0文 件###################
intranet
#在/etc/hostname.ce0填入计算机名:intranet,标 识ce0网卡配置172.16.0.8的IP地址
##################################################

 

#############修改/etc/hostname.ce1文 件####################
internet
#在/etc/hostname.ce1填入计算机名internet标识 ce1网卡配置192.168.0.8的IP地址
##################################################

 

#########/etc/netmasks################################
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
#       network-number  netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
#               128.32.0.0 255.255.255.0
#
172.16.0.0 255.255.255.0
192.168.0.0 255.255.255.0
#配置IP地址的掩码
##################################################


2.2双网卡出口路由配置
A、默认路由配置

#######/etc/defaultrouter##############################
192.168.0.8
# 配置默认路由为192.168.0.8
##################################################


由于solaris只能配置一个默认路由,因此必须按照如下方法设置静态路由。

B、配置静态路由

route add net 172.16.0.0 -netmask 255.255.0.0 172.16.0.8


想要让静态路由命令重新启动后有效,有多种方法,我这边介绍两种方法
方法一:在route后面加上-p参数,即:

route -p add net 172.16.0.0 -netmask 255.255.0.0 172.16.0.8


方法二:做一个自动启动脚本:

########/etc/init.d/routeadd##############################
#!/bin/sh
route add net 172.16.0.0 -netmask 255.255.0.0 172.16.0.8
##################################################


在/etc/rc2.d创建一个连接

ln -s /etc/init.d/routeadd /etc/rc2.d/S99routeadd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值