免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: haide1014
打印 上一主题 下一主题

关于不同网段组网 [复制链接]

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
41 [报告]
发表于 2010-08-28 12:59 |只看该作者
在linux上ping 2。1 的结果呢?

论坛徽章:
0
42 [报告]
发表于 2010-08-28 13:51 |只看该作者
不通,就是到网段B的机器都不通,

论坛徽章:
0
43 [报告]
发表于 2010-08-28 13:54 |只看该作者
本帖最后由 haide1014 于 2010-08-28 13:56 编辑
  1. linux的路由配置
  2. -------------------------------------------------------------------------------
  3. [root@CentOS ~]# netstat -nr
  4. Kernel IP routing table
  5. Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
  6. 192.168.7.0      0.0.0.0         255.255.255.0   U         0 0          0 eth1
  7. 192.168.2.0      0.0.0.0         255.255.255.0   U         0 0          0 eth0
  8. 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
  9. 192.168.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth0
  10. 192.168.0.0      0.0.0.0         255.255.0.0     U         0 0          0 eth1
  11. 0.0.0.0         192.168.2.1      0.0.0.0         UG        0 0          0 eth0
  12. --------------------------------------------------------------------------------

  13. linux的网卡配置信息
  14. [root@CentOS ~]# ifconfig
  15. eth0      Link encap:Ethernet  HWaddr 00:40:CA:79:72:7A  
  16.           inet addr:192.168.2.10  Bcast:172.168.255.255  Mask:255.255.0.0
  17.           inet6 addr: fe80::240:caff:fe79:727a/64 Scope:Link
  18.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  19.           RX packets:26200 errors:0 dropped:0 overruns:0 frame:0
  20.           TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
  21.           collisions:0 txqueuelen:1000
  22.           RX bytes:1902836 (1.8 MiB)  TX bytes:25089 (24.5 KiB)
  23.           Interrupt:193 Base address:0xa000

  24. eth1      Link encap:Ethernet  HWaddr 00:1D:0F:13:5D:1A  
  25.           inet addr:192.168.7.7  Bcast:192.168.255.255  Mask:255.255.0.0
  26.           inet6 addr: fe80::21d:fff:fe13:5d1a/64 Scope:Link
  27.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  28.           RX packets:435 errors:0 dropped:0 overruns:0 frame:0
  29.           TX packets:141 errors:0 dropped:0 overruns:0 carrier:0
  30.           collisions:0 txqueuelen:1000
  31.           RX bytes:38168 (37.2 KiB)  TX bytes:19712 (19.2 KiB)
  32.           Interrupt:169 Base address:0x8000


  33. --------------------------------------------------------------------------------

  34. linux服务器的sysctl.conf配置文件

  35. [root@CentOS ~]# cat /etc/sysctl.conf
  36. # Kernel sysctl configuration file for Red Hat Linux
  37. #
  38. # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
  39. # sysctl.conf(5) for more details.

  40. # Controls IP packet forwarding
  41. net.ipv4.ip_forward = 1

  42. # Controls source route verification
  43. net.ipv4.conf.default.rp_filter = 1

  44. # Do not accept source routing
  45. net.ipv4.conf.default.accept_source_route = 0

  46. # Controls the System Request debugging functionality of the kernel
  47. kernel.sysrq = 0

  48. # Controls whether core dumps will append the PID to the core filename
  49. # Useful for debugging multi-threaded applications
  50. kernel.core_uses_pid = 1

  51. # Controls the use of TCP syncookies
  52. net.ipv4.tcp_syncookies = 1

  53. # Controls the maximum size of a message, in bytes
  54. kernel.msgmnb = 65536

  55. # Controls the default maxmimum size of a mesage queue
  56. kernel.msgmax = 65536

  57. # Controls the maximum shared segment size, in bytes
  58. kernel.shmmax = 4294967295

  59. # Controls the maximum number of shared memory segments, in pages
  60. kernel.shmall = 268435456

  61. --------------------------------------------------------------------------------


  62. 网段B的路由表
  63. SZ#show ip route
  64. Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
  65.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
  66.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
  67.        E1 - OSPF external type 1, E2 - OSPF external type 2
  68.        i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
  69.        ia - IS-IS inter area, * - candidate default, U - per-user static route
  70.        o - ODR, P - periodic downloaded static route

  71. Gateway of last resort is 192.168.4.1 to network 0.0.0.0

  72.      192.168.0.0/24 is subnetted, 2 subnets
  73. S       192.168.7.0 [1/0] via 192.168.2.10
  74. C       192.168.2.0 is directly connected, FastEthernet0/1
  75.      172.19.0.0/24 is subnetted, 1 subnets
  76. C       192.168.4.1 is directly connected, FastEthernet0/0
  77.      172.18.0.0/24 is subnetted, 1 subnets
  78. C       192.168.3.1 is directly connected, Serial0/1/0
  79. S*   0.0.0.0/0 [1/0] via 192.168.4.1
  80.                [1/0] via 192.168.3.1


  81. 网段B的arp表

  82. SZ#show arp
  83. Protocol  Address          Age (min)  Hardware Addr   Type   Interface
  84. Internet  192.168.2.0             61   6cf0.498b.0726  ARPA   FastEthernet0/1
  85. Internet  192.168.2.1              0   0023.cd8d.d949  ARPA   FastEthernet0/1
  86. Internet  192.168.2.2              -   0026.9972.ec7b  ARPA   FastEthernet0/1
  87. Internet  192.168.2.3            128   001d.0fa3.e051  ARPA   FastEthernet0/1
  88. Internet  192.168.2.4              0   000e.7ffe.9a70  ARPA   FastEthernet0/1
  89. ............................................................................
  90. Internet  192.168.4.1            155   0025.454d.15b6  ARPA   FastEthernet0/0
  91. Internet  192.168.3.1              -   0026.9972.ec7a  ARPA   FastEthernet0/0

复制代码

论坛徽章:
0
44 [报告]
发表于 2010-08-28 13:57 |只看该作者
现在是网段B的机器已超过了254台了,就想出了这样的办法。

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
45 [报告]
发表于 2010-08-28 14:12 |只看该作者
inet addr:192.168.2.10  Bcast:172.168.255.255  Mask:255.255.0.0

怎么搞的啊。

先解决ping 192.168.2.1 的问题。

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
46 [报告]
发表于 2010-08-28 14:26 |只看该作者
现在是网段B的机器已超过了254台了,就想出了这样的办法。
haide1014 发表于 2010-08-28 13:57



   

早知道是这样啊,你在路由器B的接口上把掩码缩一位,或者是配置个辅助地址就解决了。

论坛徽章:
0
47 [报告]
发表于 2010-08-28 14:38 |只看该作者
本帖最后由 haide1014 于 2010-08-28 14:53 编辑
早知道是这样啊,你在路由器B的接口上把掩码缩一位,或者是配置个辅助地址就解决了。
ssffzz1 发表于 2010-08-28 14:26


是指在网段B中的路由器那个接局域网交换机的端口掩码缩一位吗?

interface FastEthernet0/1
ip address 192.168.2.1 255.255.255.0

这是现在的接口配置,改为255.255.0.0吗?
    具体如何操作,对思科路由器不是特别懂。嘿嘿

论坛徽章:
0
48 [报告]
发表于 2010-08-28 14:39 |只看该作者
回复 45# ssffzz1


   努力测试中。

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
49 [报告]
发表于 2010-08-28 14:47 |只看该作者
255.255.254.0

这样172.16.2-3.0 范围内的都属于这个网段了。前提是你172.16.3.0 这个没有被使用过。
要不就配置一个辅助地址就OK了。

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
50 [报告]
发表于 2010-08-28 14:48 |只看该作者
[root@CentOS ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:40:CA:79:72:7A  
          inet addr:192.168.2.10  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::240:caff:fe79:727a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:312738 errors:0 dropped:0 overruns:0 frame:0
          TX packets:709 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23844123 (22.7 MiB)  TX bytes:66552 (64.9 KiB)
          Interrupt:193

eth1      Link encap:Ethernet  HWaddr 00:1D:0F:13:5D:1A  
          inet addr:192.168.7.7  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::21d:fff:fe13:5d1a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:334 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35396 (34.5 KiB)  TX bytes:14706 (14.3 KiB)
          Interrupt:169 Base address:0x2000


你这个地方也不对啊,掩码是255.255.255.0的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP