免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3422 | 回复: 0
打印 上一主题 下一主题

Solaris 10 配置双网卡双网关出口[转] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-26 15:16 |只看该作者 |倒序浏览
经常有一些朋友问如何在Solaris 10配置双网,并设置两个网关出口,下面我就把Solaris 10 双网卡双网关的配置帖出来给大家参考一下。
一、环境描述
            +-----------+          +-------------+  
            |      |          |   Rourer1  |  
            |      | CE0:172.16.0.8→ |  172.16.0.1 | ------>172.16.0.0/16   
IXDBA.NET社区论坛
            |      |          +-------------+
            |  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
想要让静态路由命令重新启动后有效,有多种方法,我这边介绍两种方法
方法一:可以把这条命令加到系统环境设置文件如/profile(如果打过补丁/profile-EIS)
方法二:做一个自动启动脚本:
########/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


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/60332/showart_2037708.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP