ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux下如何加入路由,使多个不同网段能相互访问

Linux下如何加入路由,使多个不同网段能相互访问

原创 Linux操作系统 作者:tolywang 时间:2007-11-02 00:00:00 0 删除 编辑

Linux下设置路由,使多个不同网段能相互访问。 Linux AS3.0 。


[root@PDM8_NewDB etc]# cat 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
/opt/Navisphere/bin/naviserverutilcli update

route add -net 10.16.0.0 netmask 255.255.0.0 gw 10.16.24.1 dev eth0
route add -net 10.15.0.0 netmask 255.255.0.0 gw 10.16.24.1 dev eth0
route add -net 10.19.0.0 netmask 255.255.0.0 gw 10.16.24.1 dev eth0

[root@PDM8_NewDB etc]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1D:09:08:7A:AB
inet addr:10.161.24.60 Bcast:10.16.27.255 Mask:255.255.252.0
inet6 addr: fe80::21d:9ff:fe08:7aab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:216785968 errors:0 dropped:0 overruns:0 frame:0
TX packets:107362918 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:325968126242 (303.5 GiB) TX bytes:7519689253 (7.0 GiB)
Interrupt:169 Memory:d6000000-d6011100

eth1 Link encap:Ethernet HWaddr 00:1D:09:08:7A:A9
inet addr:10.14.68.22 Bcast:192.168.11.255 Mask:255.255.252.0
inet6 addr: fe80::21d:9ff:fe08:7aa9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:524084 errors:0 dropped:0 overruns:0 frame:0
TX packets:2133 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43949525 (41.9 MiB) TX bytes:137236 (134.0 KiB)
Interrupt:169 Memory:da000000-da011100

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:63645 errors:0 dropped:0 overruns:0 frame:0
TX packets:63645 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3182601 (3.0 MiB) TX bytes:3182601 (3.0 MiB)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-84990/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle SQL优化流程
请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13424533