How to get a Virtual IP for Keepalived with bare-metal infrastructure - infrastructure

I am configuring a High Availability load balancing based on HAProxy and Keepalived.
Everywhere I do research they talk about Virtual IP like something that fell off the sky – I mean, with little to none explanation about how to get one.
By now, I have arbitrary defined a virtual ip address in the keepalived.conf like this:
virtual_ipaddress {
10.0.0.100
}
With both Servers running keepalived, I do ip address command in the MASTER machine and it shows inet 10.0.0.100/32 scope global eth0 next to the Public IP, which I believe is correct.
When I do service keepalived stop in the MASTER machine and run ip address in the BACKUP machine, BACKUP shows inet 10.0.0.100/32 scope global eth0, IP which effectively disappeared from MASTER.
The above mentioned behavior indicates me that the config is all right.
Now, how can I publish that Virtual IP? Do I need to buy one? If my server provider (Contabo) doesn't offer the Virtual IP service, where to buy it?
My goal is to have my Front-End API requests aiming at the Virtual IP.
Thanks very much in advance for any guidance!

Server A and server B addresses are either manually configured when setting up the servers, or obtained via dhcp.
There is nothing magical about the virtual ip, other than it is not obtained in the same way.
If it is your own network, you can just pick one in the same range as for the two servers, and make sure that no new servers will use it.
Since you are talking about a provider, you will need to ask them if they provide floating ip addresses.
10.x.x.x is a private ip, so you can not publish that to the internet, but you could use it for example to fail over internal services.

Related

Client Server Logs Shows Public IP instead of Spoof IP in Jmeter

As the title says, I have been tasked to do Load and Performance Testing on a Client's Server, I have followed all steps, made additional IPs and added it to the system, and entered the same IPs in Jmeter using CSV dataset, and Debug Postproccessor shows that the request is being sent with the correct IPs. I am doing this over wifi, so hopefully that isn't the issue.
Any help is appreciated.
System config
OS: Windows 10 64 bit
Ram: 16gb
Jmeter Version 5.4.3
It may easily happen if you're behind NAT and the server is in the Internet, in that case no matter what is your local IP address(es), the server will "see" only the address of your NAT gateway, you can check yourself using websites like https://www.whatismyip.com/
The trick with local IP addresses (or aliases) will succeed only in case of local intranet, when it comes to Internet - you will need to have as many global static IP addresses as many users you're trying to simulate.
One of the possible solutions is kicking off virtual machines in AWS or Azure or similar service or asking your ISP to provide you a pool of IP addresses you could use (normally you will need to pay for this) and go for distributed testing so each JMeter slave would have its own IP address (or several) to bind.

Proxmox external VM / CT access

I've just begun the setup of proxmox for our none profit educational VPS service. However, the problem we're facing is a lack of IPv4 addresses available to us.
Is it possible to route a sub-domain to the host servers IP address and then get that forwarded to the individual containers accordingly. For example:
SSH root#node-123.w-a-s-d.me
Will allow a client with the VM ID of 123 to access their server
And the same goes for things like: node-123.w-a-s-d.me
This would be the web address allowing any applications running on port 80 for that specific node
I'm unsure how to go about this and have looked online with no luck. I hope our goal is clear. I look forward to hearing from you. Josh
Exposing SSH that way will not be easy as you can only have one thing listening on port 22 for every given IP address, and while you could just adding random ports to each VPS and the forward it from primary box which holds public IP (and vms are behind nat) this is not exactly the best solution.
What you may want to do instead is set up one public-facing box that people can ssh into via public IP and from it SSH to subsequent private machines by their internal IP. Alternatively you can set that box with openVPN and set it to assign internal IP address to anyone connecting via it. While openVPN takes more time to set up right, it can come with it's own DNS so when connected to it calling out SSH root#node-123.w-a-s-d.me will automatically route you to the private IP address rather than the shared public facing one.
With HTTP this is much easier as you can set up a proxy on the front-facing machines which then proxies requests for given sub domain to specific internal IP address.

Access xampp from VMWARE to Public IP

Is it possible to access 127.0.0.1:8080 publicly i have a project application that is running on VM, What should I do?
Diagram:
VMachine( where xampp is installed) IP <-> Global(external) IP (167.1.174.21:8080)
I don't have any option left what should i do i'm really new to this. #respect
Yes, this is possible but there are multiple steps to the configuration and the details for each steps differ depending on the hardware/software used. In general though it can be accomplished like this:
VMware config
Configure the VM with a bridged network
Configure the guest OS to either have a dhcp reservation or static ip.
Router config
Add a dhcp reservation for the VM (if using DHCP)
Add a port forwarding rule pointing to the VM's IP address
XAMPP config
Make sure the XAMPP server is listening on all interfaces.
The key point is to make the Virtual Machine to have bridged connection.
You can do it by looking at this one.
After that do a Port Forwarding to the virtual machine like it a real machine on your LAN.
Step 1 : Apart from above solution, in your local network where xampp is installed, make your local ip as static one, like "192.168.1.125" from router settings->Address reservation option.
Once you reserve address
Step 2 : Open your router->port forwarding->set port & ip to forward.
Step 3 : Now you check your public ip, and bingo now you can go to your public ip from vmware or from any other network.
As long as the vm has a configured network and is therefor able to communicate with your LAN (using Bridged networks in the VM configuration is a good way to go) and the internet, it is possible to make it accessible to the external web/internet.
Therefor you would most likely need to define a port-redirect/port forwarding on your router, that all incoming packets on the external IP (167.1.174.21) on port 8080 gets forwarded to the local ip of your vm and the related xampp session.
A possible problem at that point might be changing IP addresses of the VM based on a possible DHCP configuration. Either use a fixed IP on the VM or configure some mac-based rule for fixed IP or increase the lease time of the dhcp-server (your router to unlimited)
That's the theory, but please think twice before you do so. Running a webserver which is available in the wild is not recommended if you are not used to IT security. And even if you decide to do so, using xampp sounds wrong to me ears. xampp is designed for local development & testing purposes, not for productive use.

java socket server hosting

I am creating an android client app connected to a Java server using sockets. At the moment I am working both on my pc. How can I upload my Java server to an online server so I can set my app to friends and test it?
I used OpenShift but could figure our how and if I can use it for what I want.
Also I looked at Amazon ec2, but they need credit card information, something that I would prefer not sharing for this.
Is there any way I can do this for free?
Thanks
Make sure you have a computer able to connect to the internet, and that can run 24/7. Then run your server on that computer, assume you run it on port 8080. Make sure that your host computer's IP address is it to static, otherwise DHCP will give it a different IP every time it connects to the router.
To allow your friends to connect, unless if they're on the same LAN as your host, you will need to port forward port 80 -> ComputerIP:8080 on your router. Once that's done, you will need to retrieve your router's global IPv4 address from it's configuration page and then send that to your friends.
If they're on the same LAN as your host, then you can just give them the IP address of your host computer.
If you port forwarded your server and you would like to get a host name, like stackoverflow.com, you're going to need to buy that from whoever owns the host name you would like to use. I don't know many details about how to update the DNS servers though.
If your server is local and you would like a host name, then just go onto your router configurations page and tell it to automatically assign each computer the default gateway as the primary DNS and then add a mapping in the router's DNS settings to map the host name to your computer's local IPv4 address. Note that not all routers support this feature.
Edit: You'll also need a good bandwidth to support multiple simultaneous connections.

Do we have to buy a domain to serve Bugzilla?

I tried putting my IP from whatismyip.com in the urlbase of Bugzilla but it did not work. I wasn't able to create a new account for my team mate, and he wasnt able to access the server by typing the my ip address in his browse. And surely, when I connect again, my IP address will change. Do we have to buy a www address to host Bugzilla?
You can setup a dynamic dns service, for example via http://www.dyndns.com or http://www.no-ip.com or http://freedns.afraid.org to solve the changing ip problem without buying a domain (or buying a domain as well, but it's not a requirement).
But the real problem is that your team mate cannot access the server via the current IP address which points to either a misconfiguration of the webserver (listening only on localhost?), to a firewall in between, or most likely, that port forwarding isn't set up in your router for requests coming to your external IP address to be forwarded to the machine where you have Bugzilla set up. Additionally, you must set the urlbase to your local IP address, not to the external IP address, as blak3r says.
Check http://www.portforward.com for instructions on how to do port forwarding. But don't forget that everything mentioned has to be working:
Web server listening to outside requests: This can be tested from the same internal network via the local network IP address (what you see typing in a command line console ipconfig in Windows and ifconfig in Linux). If you can connect from a different machine on the same network via the local IP address, this is solved.
Firewalls (in router and the webserver machine) accepting connections to the web server port: For firewalls in the web server, the same test as above covers it.
Port forwarding so the router forwards the requests received on the web server port to the web server machine: This gets tested in the same way as firewalls in the router, that is, you must have your friend (or yourself from the house of your friend) try to connect to the dyn dns name set up or to the external IP as reported by whatsmyip.org.
This is all assuming your test mate is not on your same network, if he is, just using the local IP address (shown via ipconfig or ifconfig) instead of the external IP address and making sure the first step is covered (web server listening to outside requests) should be enough and nothing else is needed!
You most likely do not have your port 80 forwarded to your machine which is the reason he cannot connect when using the IP that was returned from whatismyip.com.
Assuming you're on a windows box... do
Start->Run->cmd then type
ipconfig
If your address starts with 192...* or 10...* this is your Local Area Network (LAN) IP. If this is the case, then your isp provided you with a router. Look for a setting called port forwarding or "application setting" which allows you to forward all incoming traffic on your router to a particular IP address. Go into your router's configuration settings and make sure port 80 (and maybe 443 if you're using ssl are forwarded to your local ip).
The other problem you mentioned is you do not have a static IP. This is a common problem and no you do not need to buy an address. There are several sites which can provide you a free dynamic dns host. Try no-ip.org.

Resources