lyfsy

Multiple FO IPs in a VM on top of Proxmox OVH Dedicated

Dec 30th, 2019
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. Multiple FO IPs in a VM on top of Proxmox -> OVH Dedicated Server
  2. I have a cPanel (CloudLinux 7) VM running in Proxmox on top of a dedicated server with OVH. I've managed to get one FailOver IP working on it just fine, but none of the tutorials online describe how to do it when it comes to multiple FO IPs from multiple IP blocks attached to the server.
  3. ++++++++++++++
  4. list of top cheapest host http://Listfreetop.pw
  5.  
  6. Top 200 best traffic exchange sites http://Listfreetop.pw
  7.  
  8. free link exchange sites list http://Listfreetop.pw
  9. list of top ptc sites
  10. list of top ptp sites
  11. Listfreetop.pw
  12. Listfreetop.pw
  13. +++++++++++++++
  14. I attempted to address this by creating multiple network interfaces from vmbr0 and assigning each one of them a single vMAC (the same ones generated by OVH). Then I copied the ifcfg-eth0 file into "ifcfg-eth1", replaced the IP and gateway in it to no avail, the eth1 interface (where the second FO IP is tied to) won't ping the outside world or the other way around.
  15.  
  16. Having to keep multiple virtual NICs just for the sake of having multiple IPs doesn't seem like a very elegant solution, so I suppose I'm way off here. I was thinking of having one interface with multiple VLANs inside the VM, one for each IP or something along those lines.
  17.  
  18. Any assistance is greatly appreciated.
  19. php example :
  20.  
  21. /**
  22. * get client ip
  23. * @Param integer $type 0:ip 1 :num
  24. * @return mixed
  25. */
  26.  
  27. function get_client_ip($type = 0) {
  28. $type = $type ? 1 : 0;
  29. static $ip = NULL;
  30. if ($ip !== NULL) return $ip[$type];
  31. if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  32. $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
  33. $pos = array_search('unknown',$arr);
  34. if(false !== $pos) unset($arr[$pos]);
  35. $ip = trim($arr[0]);
  36. }elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
  37. $ip = $_SERVER['HTTP_CLIENT_IP'];
  38. }elseif (isset($_SERVER['REMOTE_ADDR'])) {
  39. $ip = $_SERVER['REMOTE_ADDR'];
  40. }
  41. $long = sprintf("%u",ip2long($ip));
  42. $ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
  43. return $ip[$type];
  44. }
  45.  
  46. $ip= get_client_ip();
  47.  
  48. //------------------------------------------------------
  49. SaveToFile("/tmp/iplisting.txt", $ip);
  50.  
  51. Header("Location home.php");
  52. php example :
  53.  
  54. /**
  55. * get client ip
  56. * @Param integer $type 0:ip 1 :num
  57. * @return mixed
  58. */
  59.  
  60. function get_client_ip($type = 0) {
  61. $type = $type ? 1 : 0;
  62. static $ip = NULL;
  63. if ($ip !== NULL) return $ip[$type];
  64. if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  65. $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
  66. $pos = array_search('unknown',$arr);
  67. if(false !== $pos) unset($arr[$pos]);
  68. $ip = trim($arr[0]);
  69. }elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
  70. $ip = $_SERVER['HTTP_CLIENT_IP'];
  71. }elseif (isset($_SERVER['REMOTE_ADDR'])) {
  72. $ip = $_SERVER['REMOTE_ADDR'];
  73. }
  74. $long = sprintf("%u",ip2long($ip));
  75. $ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
  76. return $ip[$type];
  77. }
  78.  
  79. $ip= get_client_ip();
  80.  
  81. //------------------------------------------------------
  82. SaveToFile("/tmp/iplisting.txt", $ip);
  83.  
  84. Header("Location home.php");
  85.  
  86. host jobs
  87. imgmega.com
  88. fallout 1 make money
  89. hosting 2019 grammys
  90. domain mall
  91. domain information
  92. drupal 8 hosting free
  93. 3 host vsan
  94. ptp4ever.fr
  95.  
  96. Thanks, but I'm not sure how this is related to this topic.
  97.  
  98. Anyway, in case someone goes through the same situation, the solution was pretty straightforward: Proxmox's default settings work just fine for that purpose but you must use the same vMAC address for all IPs attached to the VM's public interface. I had no idea OVH's Manager V6 allowed that, it can be done through the "Use an existing Mac Address" option. Problem solved.
Advertisement
Add Comment
Please, Sign In to add comment