全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: lsylsy2
打印 上一主题 下一主题

研究SolusVM开共享IP的OpenVZ

[复制链接]
11#
发表于 2013-5-9 13:17:59 | 只看该作者
    曾经用过的脚本贴给你  不谢  记得自己改要转发的端口  Solusvm后台添加IP池 192.168.10.0/24
  1. echo "1" >/proc/sys/net/ipv4/ip_forward
  2. iptables -F -t nat
  3. iptables -F
  4. iptables -P FORWARD ACCEPT
  5. iptables -A POSTROUTING -t nat -s 192.168.10.0/24 -o eth0 -j MASQUERADE
  6. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3002 -j DNAT --to-destination 192.168.10.2:5901
  7. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3003 -j DNAT --to-destination 192.168.10.3:5901
  8. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3004 -j DNAT --to-destination 192.168.10.4:5901
  9. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3005 -j DNAT --to-destination 192.168.10.5:5901
  10. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3006 -j DNAT --to-destination 192.168.10.6:5901
  11. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3007 -j DNAT --to-destination 192.168.10.7:5901
  12. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3008 -j DNAT --to-destination 192.168.10.8:5901
  13. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3009 -j DNAT --to-destination 192.168.10.9:5901
  14. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3010 -j DNAT --to-destination 192.168.10.10:5901
  15. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3011 -j DNAT --to-destination 192.168.10.11:5901
  16. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3012 -j DNAT --to-destination 192.168.10.12:5901
  17. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3013 -j DNAT --to-destination 192.168.10.13:5901
  18. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3014 -j DNAT --to-destination 192.168.10.14:5901
  19. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3015 -j DNAT --to-destination 192.168.10.15:5901
  20. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3016 -j DNAT --to-destination 192.168.10.16:5901
  21. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3017 -j DNAT --to-destination 192.168.10.17:5901
  22. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3018 -j DNAT --to-destination 192.168.10.18:5901
  23. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3019 -j DNAT --to-destination 192.168.10.19:5901
  24. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3020 -j DNAT --to-destination 192.168.10.20:5901
  25. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3021 -j DNAT --to-destination 192.168.10.21:5901
  26. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3022 -j DNAT --to-destination 192.168.10.22:5901
  27. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3023 -j DNAT --to-destination 192.168.10.23:5901
  28. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3024 -j DNAT --to-destination 192.168.10.24:5901
  29. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3025 -j DNAT --to-destination 192.168.10.25:5901
  30. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3026 -j DNAT --to-destination 192.168.10.26:5901
  31. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3027 -j DNAT --to-destination 192.168.10.27:5901
  32. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3028 -j DNAT --to-destination 192.168.10.28:5901
  33. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3029 -j DNAT --to-destination 192.168.10.29:5901
  34. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3030 -j DNAT --to-destination 192.168.10.30:5901
  35. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3031 -j DNAT --to-destination 192.168.10.31:5901
  36. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3032 -j DNAT --to-destination 192.168.10.32:5901
  37. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3033 -j DNAT --to-destination 192.168.10.33:5901
  38. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3034 -j DNAT --to-destination 192.168.10.34:5901
  39. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3035 -j DNAT --to-destination 192.168.10.35:5901
  40. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3036 -j DNAT --to-destination 192.168.10.36:5901
  41. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3037 -j DNAT --to-destination 192.168.10.37:5901
  42. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3038 -j DNAT --to-destination 192.168.10.38:5901
  43. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3039 -j DNAT --to-destination 192.168.10.39:5901
  44. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3040 -j DNAT --to-destination 192.168.10.40:5901
  45. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3041 -j DNAT --to-destination 192.168.10.41:5901
  46. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3042 -j DNAT --to-destination 192.168.10.42:5901
  47. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3043 -j DNAT --to-destination 192.168.10.43:5901
  48. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3044 -j DNAT --to-destination 192.168.10.44:5901
  49. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3045 -j DNAT --to-destination 192.168.10.45:5901
  50. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3046 -j DNAT --to-destination 192.168.10.46:5901
  51. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3047 -j DNAT --to-destination 192.168.10.47:5901
  52. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3048 -j DNAT --to-destination 192.168.10.48:5901
  53. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3049 -j DNAT --to-destination 192.168.10.49:5901
  54. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3050 -j DNAT --to-destination 192.168.10.50:5901
  55. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3051 -j DNAT --to-destination 192.168.10.51:5901
  56. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3052 -j DNAT --to-destination 192.168.10.52:5901
  57. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3053 -j DNAT --to-destination 192.168.10.53:5901
  58. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3054 -j DNAT --to-destination 192.168.10.54:5901
  59. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3055 -j DNAT --to-destination 192.168.10.55:5901
  60. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3056 -j DNAT --to-destination 192.168.10.56:5901
  61. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3057 -j DNAT --to-destination 192.168.10.57:5901
  62. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3058 -j DNAT --to-destination 192.168.10.58:5901
  63. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3059 -j DNAT --to-destination 192.168.10.59:5901
  64. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3060 -j DNAT --to-destination 192.168.10.60:5901
  65. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3061 -j DNAT --to-destination 192.168.10.61:5901
  66. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3062 -j DNAT --to-destination 192.168.10.62:5901
  67. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3063 -j DNAT --to-destination 192.168.10.63:5901
  68. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3064 -j DNAT --to-destination 192.168.10.64:5901
  69. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3065 -j DNAT --to-destination 192.168.10.65:5901
  70. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3066 -j DNAT --to-destination 192.168.10.66:5901
  71. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3067 -j DNAT --to-destination 192.168.10.67:5901
  72. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3068 -j DNAT --to-destination 192.168.10.68:5901
  73. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3069 -j DNAT --to-destination 192.168.10.69:5901
  74. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3070 -j DNAT --to-destination 192.168.10.70:5901
  75. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3071 -j DNAT --to-destination 192.168.10.71:5901
  76. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3072 -j DNAT --to-destination 192.168.10.72:5901
  77. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3073 -j DNAT --to-destination 192.168.10.73:5901
  78. iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 3074 -j DNAT --to-destination 192.168.10.74:5901


  79. 太长 我就发了一部分,你自己加把
复制代码
——来自VPS爱唯欧

点评

好顶赞!  发表于 2013-5-10 08:20
12#
 楼主| 发表于 2013-5-9 13:20:13 | 只看该作者
KVMLA 发表于 2013-5-9 12:58
solusvm没有打算做共享IP,开通小鸡后得自己手工弄。

蛋疼……建立内网么
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-9-30 23:13 , Processed in 0.140423 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表