Setting static IP address in Hana Express Edition - hana

I have installed at work SAP Hana Express Edition 2.0 in my laptop. It runs on VMware/Suse. I also set up a static IP address so I don't have to change the client connections. This works fine when I'm at work.
I added the following to hosts file:
192.168.1.85 hxehost
Problem is that when I take my laptop somewhere else all my client connections time out. I checked the IP address in Suse and it's the one I assigned. How to fix this problem?
If I disconnect the laptop from the Internet, I get the following error:
JDBC: Cannot connect to jdbc:sap://192.168.1.85:39013/ [Cannot connect to
host 192.168.1.85:39013 [No route to host: connect],
This is my setup:

How you connect to the virtual machine's IP ports depends on the setup chosen for the VM networking.
The address 192.168.1.85 is part of the 192.168.1.x network, which is very popular for home-router setup and small LANs. It's very likely that your laptop is part of such a network, when not at work. So when you ping the address the laptop uses the network interface that is linked to this network (e.g. your wifi adapter) to look for the host with IP 192.168.1.85. Whoever host currently got the 85 in your network, it's likely not your virtual machine.
One easy way to avoid this is to setup the virtual machine with host-only network. For that you have to configure the network adapter in VMware (or whatever hypervisor you use) to use the host-only network and assign an IP address in a different subnet e.g. in 192.168.5.x. For the HANA client software on your computer, the address to use would, of course, be 192.168.5.85 but it would be stable across all networks your laptop may log into.

Related

How can I communicate a guest VM to Host using Host-Only Adapter? (Virtual Box)

I'm trying to make a connection from a guest virtual machine (VM) to host. I can from host to the guest VM, but not viceversa.
The context:
I'm trying to gain root access on a CTF VM from VulnHub.com, and I configured the guest VM (the CTF VM) network to Host-Only. Instead, if I choose Bridged Adapter, it works normally, but it means the VM is connected "directly" to my physical network adapter, and I want to avoid that for security reasons.
Some other thing I read is set 2 adapter: NAT and Host-Only, but it gives me only the NAT ip address range (10.0.x.x).
Basically, I want to use netcat to make a connection sending a reverse shell from the guest VM to the host, but I want to make it work with the Host-Only Adapter, not Bridged Adapter. How can I make it work?
I found the problem. It was I xd
Why? Because I was trying to access from the host-only adapter (named vboxnet0 in my machine) to the psysical adapter (a switch router). The host-only is a configuration which isolates the networking between the host machine and the guest virtual machine.
So, the IP (IPv4 address) to communicate from guest to host was specified when I created vboxnet0 on Host Network Manager (VirtualBox 6.1). And IS NOT the one I found using the command ifconfig in Linux.
I hope this can help another newbie who have this misunderstanding.
(Pro-Tip: Learn more about networking)

Accessing localhost via a VPN connection

Goal
I am trying to setup a secure connection to a PC in our network.
The goal is to be able to access a domain, api.mydomain.test, on that PC, that is served by Apache.
Setup
To securely connect to the server, I have implemented the Softether VPN Server on the PC. The VPN network must be separate from our own local network, which the PC is also on.
The idea is to add an IP whitelist in the vhost record op Apache to allow only people on the VPN subnet to connect to the domain api.mydomain.test. Next to this filter, we also added a firewall to the PC to not allow any connection on port 80 or 443.
Issue
I can connect to the VPN perfectly and receive an IP ofthe subnet 10.11.12.x.
However, I can't seem to be able to access the server on localhost or via the IP of the other network the PC is on (10.10.2.x).
To be frank, I don't even know how to do this when connected to the VPN.
What have I tried?
Use a local tap bridge instead of virtualNAT and virtual DHCP.
This was not working as expected, because then the VPN clients (my laptop) did not receive an IP.
Add routes to allow 10.11.12.x IPs to access localhost.
According to documentation of Softether, the virtual NAT does not use the routes, so this would be useless for our goal.
What I do not know, is how this is normally setup?
I have the feeling I am trying to do this the wrong way, so any ideas or different approaches would be greatly appreciated!

Connecting to ubuntu home server without internet connection

I am running an Ubuntu server with my laptop through an Orcale VirtualBox and I try to maximize the bandwidth of my home server, as it really slows down my internet connection. My router supports up to 300Mbit upload/download speed and my laptop wifi's card up to 150bit.
I configured my server with the following(static IP, configured by vim /etc/network/interfaces):
auto eth0
iface eth0 inet static
address 192.168.1.240
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
192.168.1.1 is my default gateway, and I just configured a static IP which ends with 240.
When my laptop's WIFI is on, I can easily access the server's files(.html files etc) through chrome from any computer on my house, as I just need to enter the server's IP into the browser, plus I can access the server through SSH. But when It's off, I can't even access the server's HTML files through the laptop itself, though I can see that the server is still running on VirtualBox. When I turn the WIFI once again, I can run services which require Apache2 but they really slow my internet connection, as a result I can barely surf the web. I am trying to configure the server to use only the bandwidth of my router, since my actual internet connection is 30 Mbit download and 1.90 Mbit upload(according to speedtest), and It probably interferes with it. Is it possible to access the server without WIFI connection, so it will purely use my router's speed?
Any help would be appreciated.
1) Looks like you using bridged networking in VM config. When your network adapter is connected to real network - you can interact with your VM via network bridge. When it's not connected - your bridge is also closed. If you need to interact with your VM without WiFi connection - you can add one more virtual network adapter to you VM config: use "Host-only" adapter and configure it on both VM and host PC. Your VM will use new host-only adapter to interact with your PC, and old bridged adapter to interact with other network.
2) Check your WiFi speed near the router. Maybe it's too far or provides too weak signal.
PS. Sorry for my poor english.

Connect to remote Openbravo ERP Appliance

I have my Openbravo appliance running by VMWare workstation on top of Win7 which is in a LAN connected to internet by router.
When I start the appliance. I can access ERP web console by typing in the address it gave at the end of the process (for example, 192.168.1.107). All computer in the LAN can access this address as well which is fine for now.
However, in the future, I need to access this console from my home pc running Win7 (which is, of course, connected to the internet). How do i set this up?. I have try the method given in http://planet.openbravo.com/?p=8612 (see case 3 - Expose my local ERP into a remote network)
I tried (in Openbravo Appliance console running in VMWare)
ssh -R :9999:localhost:80 myhomepc#101.108.70.128
(where 101.108.70.128 is the ip of my home pc read from whatismyip.org)
but it give the following error:
ssh: connect to host 101.108.78.128 port 22: connection timed out
Do I missed any step required?
What should i do the successfully connect to my Openbravo instance?
Best is to ask those questions directly in the Openbravo ERP forums over there: http://forge.openbravo.com
The case 3 from the blog-post you are referring to makes 2 implicit assumptions.
a.) the remote computer runs an ssh-server
b.) This ssh-server can be connected to from the erp instance
One of the two assumptions seems to not hold in your case either your win7 box does not run an ssh server and/or the router of your home network does not forward port 22 from the outside to your win7 box.
Without further information i assume both items are not done.
Let me propose another solution instead. As you want to connct to the commandline of the erp appliance from home you could do the following:
Configure the router of the network with the erp appliance to connect some external port (i.e. 2222) to the ip of the appliance, destination port 22.
This will allow you to access it from the home network (or any other system from the internet knowing the ip/port).
Using an external port different from 22 some simple ssh brute-force passwords scans.
As the appliance by default does not allow login by password but only allows authentication by public-key this is secure to not allow unauthorized access to your system.
After this either use case 1 from the blog-post or an normal ssh tunnel like (ssh -p external-port user#externalipoferplan -L 9999:localhost:22' and then access the ERP via 'http://localhost' from your win7 box.
If that is too complicated and you want to just make the ERP webinterface available from the internet without having the extra ssh security in the middle then you can just configure the router of the erp lan instead to forward port 80 or 443 (http or https) to the erp-instance and access the system directly from anymore as if it would be on some public server in the internet.

Broadcasting hostname and IP address

In order to notify all computers within the same LAN about my existence, I want to broadcast my hostname and IP address.
How do I go about doing so without sending them as a string?
Avik, this is what DNS is meant to be used for. While "regular" DNS is meant to hold names and IP addresses for each machine (statically configured), there is a dynamic DNS protocol which allows machines to update their DNS entries in real time.
This sort of capability is used in some of the office environments for my clients where printers on a machine are shared but the machines they're attached to use DHCP (meaning their IP address can change).
See here and here for details and the Windows implementation with DHCP.
Lets call your machine that wants to advertise itself the SERVER and all the machines that can use it, the CLIENTS.
Of course, dynamic DNS only notifies DNS itself of the name/IP mapping and is useful if the CLIENTS are already aware of your SERVER so they can get the IP address from DNS. If you have no way for CLIENTS to discover that your SERVER has just been added, you'll still need to broadcast a packet occasionally indicating that your SERVER exists (this will only need the SERVER name since CLIENTS will use DNS to get the IP address).
This broadcast packet should be picked up by all CLIENTS and kept in a local table. If the communications from a CLIENT to your SERVER fails, the local table entry for your SERVER should be removed (it'll be re-added when your SERVER broadcasts again).
Basically re-inventing NetBIOS or ZeroConf, as popular with small embedded devices for discovery by a Windows or OS X based installer or setup utility.
You can try to use UPnP Discovery.