论坛风格切换切换到宽版
  • 746阅读
  • 6回复

[问题求助]linux 下设置多网络接口为网关出口 [复制链接]

上一主题 下一主题
离线lzzsgsb.
 
发帖
2008
C币
-262851
威望
381
贡献值
7
银元
3
铜钱
4528
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
现在的一台机器有3个网络接口
eth0 以太网接口
eth1 以太网接口
eth2 光纤接口

现在想设置et.h2为默认网关的出口.
eth0的设置里面.没有设置网关,eth2里.面设置了。.
但是用 route 查看路.由表如下:虚拟主机
[.root@scm1 ~]# route.
Kernel IP rou.ting table            杀毒
Destination   .  Gateway         Genmask         Flags Metric Re.f    .Use Iface           建材
132.194.64.0    *               255.255.255.0   U     0      0  .    . . 0 eth0    美容
132.194.6.4.0.    *      .         255.255.255.0   U     0      0        0 eth2电影
192.168.200.0   *               255.2.55.255.0   U     0 .     .0        0 eth1虚拟主机
169.254.0.0     .*       .   .     255.255.0.0     U     0      0        0 eth2    外汇
default  .       132.194.64..71   0.0.0..0         UG    0      0        0 eth0.

默认还是采用e.th0为网络网关的接口地址           女人

现在使用 route add defa.ult gw 132.194.64.71. eth2 新加一个接口地址.
现在情况如下:
K.ernel IP routing table服务器
Destination     Gateway         Genmask  .       Flags Met.ri.c Ref    Use Iface.
132.1.94.64.0    *               255.255.255.0   U   .  0      0        0 e.th0            杀毒
132.194.64.0    *               255...255.255.0   U     0      0.        0 eth2虚拟主机
192.168.20.0.0   *               255.255.255..0 .  U     0      0        0 eth1.
169.254.0.0     *   .            255.255.0.0     U     0    . . 0        0 eth2.
default  .       132.1.94.64.71   0.0.0.0         UG .   0      0        0 eth2[成人用品]
default       .  132.194.64.71   0.0..0.0         U.G    0      0        0 eth0[成人用品]


我想知道这样设置是否正确,两个接口.的想法能否成立。(广告)
在其中一个eth0 或e..th2 出错的情况下,系统能否正常运行。<性病>
现在我的环境不允许我测试。

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线jiji134.
发帖
2135
C币
-236194
威望
372
贡献值
1
银元
-3
铜钱
4705
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:linux
不知道你的接口地址是如何配置的。这个网关有是从那里来的。贴出
ifconfig -a的结果
还有/etc/sysconfig/network文件的内容。

发帖
2005
C币
-235756
威望
360
贡献值
2
银元
-4
铜钱
4376
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
Re:linux
[root@scm1 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:1A:64:24:36:98
          inet addr:132.194.64.100  Bcast:132.194.64.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:64ff:fe24:3698/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2758 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2907 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:293778 (286.8 KiB)  TX bytes:492657 (481.1 KiB)
          Interrupt:169 Memory:ce000000-ce011100

eth1      Link encap:Ethernet  HWaddr 00:1A:64:24:36:9A
          inet addr:192.168.200.1  Bcast:192.168.200.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:64ff:fe24:369a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3134 (3.0 KiB)  TX bytes:5090 (4.9 KiB)
          Interrupt:209 Memory:ca000000-ca011100

eth2      Link encap:Ethernet  HWaddr 00:15:17:25:3D:E4
          inet addr:132.194.64.99  Bcast:132.194.64.255  Mask:255.255.255.0
          inet6 addr: fe80::215:17ff:fe25:3de4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2094 errors:0 dropped:0 overruns:0 frame:0
          TX packets:939 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:293001 (286.1 KiB)  TX bytes:330481 (322.7 KiB)
          Base address:0x6000 Memory:c7ee0000-c7f00000

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:13739 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13739 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10984579 (10.4 MiB)  TX bytes:10984579 (10.4 MiB)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

[root@scm1 ~]#

[root@scm1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=scm1
[root@scm1 ~]#

离线jguzhou.
发帖
2015
C币
-235266
威望
407
贡献值
1
银元
-4
铜钱
4616
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
Re:linux
哦,的ETH0和ETH2都是同一个网段的啊。建议你吧ETH0和ETH2做成bond,尽量不要用浮动路由的方法来解决。

离线cnzol.
发帖
1942
C币
-141092
威望
321
贡献值
2
银元
0
铜钱
4152
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
Re:linux
请教斑竹 bond如何操作。
谢谢。
有啥资料可以推荐。
系统上架了。

发帖
1844
C币
-236143
威望
320
贡献值
1
银元
-2
铜钱
4095
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
Re:linux
搜吧,网上很多bond资料的,不过我不太清楚如果两网卡速率和工作模式不一致能不能做bond,你做好先实验一下。

离线korey.
发帖
2026
C币
-235337
威望
391
贡献值
1
银元
-3
铜钱
4680
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-13
Re:linux
不能混用.
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个