Accessing vitual linux-system - linux

I have just installed an virtual Linux system. I was trying to access is from a different location but I could get trough.
When I have looked up the ip-address (ifconfig) on the system, which is:
inet addr: 10.0.2.15
but I still cant seem to manage it. Can anyone help?

It depends on virtualizing software you're using, but address pretty much looks like NATed. In that case you can't directly access it, unless you'll configure VM to map virtual network controller directly to host network.

What do you mean with different location? 10.x.x.x are private IP addresses, which can only be accessed within its subnet. What IP address does the host system have?
If the host system is within 192.168.x.x subnet, then an outside computer cannot know how to access 10.x.x.x when there is no route. You have then to set up NAT on your host computer.
A more easier approach would be to use bridged networking which will then eventually get an IP address through DHCP from your router (or whatever you might have).

Related

Mimic FQDN on a home machine not on a domain

I have a home PC running Windows 10, no domain controller, and therefore by default I do not have a FQDN for the machine.
I am trying to setup some server software for testing purposes, and it requires that I use a FQDN.
How can I manipulate my hosts file to mimic a FQDN?
Extra info, please let me know in comments if you need more.
There will be no other machines trying to access this other than the machine I am running the software on (my home PC)
I also think that my IP address is not static.
I believe you can just add a host entry corresponding to the IP address of your machine to all machines that need to address it using its FQDN. The hosts file can be found in System32\Drivers\etc. Just add an entry with your IP and the host to it, for example 192.168.0.1 mymachine.local.
Another option would be setting up your own DNS server which is relatively harder. The biggest problem is presented by you not having a static IP address, you should either set a static IP or configure your DHCP server to reserve an IP for you based on your adapter's MAC address.

Perform Connect on specific NIC in a two NIC Linux system

Business case:
This is year 2015, and I am using Linux kernel 3.17. My ARM Linux has two NIC, eth0 and eth1. eth0 is for configuration purpose locally for a person next to it, and eth1 is for configuration purpose from remote. So they are basically same function, except eth0 has a person to plug in the cable in the field.
Local PC ------ [eth0 My ARM Linux Computer eth1] ------ Remote PC
Using eth0, the PC software can configure eth1 IP address and port for configuration. To do that, my eth0 has a preset IP address (192.168.1.2) so the PC software can easily find it. The ARM Linux (3.17) application needs to listen on eth0 port A, and eth1 Port B (if configured), and once connected, will respond, but never initiate any activity (not even ping).
There is no connection between local PC and remote PC. They are not supposed to be bridged, or networked.
Question 1:
If eth1 is configured with same IP as eth0, will my application still able to listen on both NIC ports, and correctly respond? I will have two independent threads (maybe same function, but different parameters) to listen on the two NIC ports.
This is why I ask whether I can specify the NIC when connect, and respond, because now you can see they could have same IP address. Ideally, the OS knows where is the connect request is from, so it should know which way to reply to, even if the two NIC have same IP as long as they have different Ethernet address. But, does C++11 or Berkeley model allow me to specify eth0 or eth1 when I listen and reply?
Now, the local PC and remote PC could have same IP address as well (but different from the ARM Linux). But imagine I have two ARM Linux computers, then this configuration is completely ok. But unfortunately I only have one embedded system and one OS with eth0 and eth1.
Question 2:
If answer to question 1 is no, then can they have same subnet mask? Also, can the local PC and remote PC have same IP address?
Assumption
Setting routing table, is a solution, if works. I wanted to know whether it is feasible and also whether it is recommended not to do it.
Also, this is Linux. Similar questions were asked long time ago for Windows, and Windows XP says (no) and I am using Linux 3.17 and I have same IP address so things are different from similar questions.
At the system level, you can configure a bridge on the mediating box. This can have the same IP address on both sides of the bridge and can be locked down using iptables to only respond to particular TCP/UDP ports.
You can't have systems on both sides of the bridge with the same IP address (i.e. the local pc and remote pc can't have the same IP address). You can use ebtables to limit the access on either side of the bridge to the IP address of the bridge itself, which means that the local pc can only talk to the mediating box and the remote pc can only talk to the mediating box.
This is based on never expecting the local and remote pcs to talk to each other.
It's mostly a sys-adminny solution, though, there's not really an API that you could use as a developer to accomplish the same thing.

Port Forwarding An Linux IP In Virtualbox ISSUES

Here's The Scoop,
I used SET (Social Engineering Toolkit) and made duplicite of a login page, the ip that was used was 10.0.2.15 (Mind you this is on a virtual machine Virtualbox), and when I tried to view it on another computer, it says the server is not responding.I tried to port forward but it was giveing me issues.
is there anything I can do to port forward or do something like that to make the web page connected to the IP viewable on the World Wide Web of another computer.
In other words, the IP's page is only viewable on the same computer who's ip I used to host, can you make it viewable on any computers browser by port forwarding it or something that will work like that.
Use bridging networking for the guest machine. Then, that IP address should be accessible on your network if there are no firewalls enabled.
There are several issues with directly accessing this IP from a separate computer.
First, the forwarding: the computer with the VirtualMachine must accept ip forwarding. This is easy to enable:
https://wiki.archlinux.org/index.php/Internet_sharing
Second, the routing: other computers must know who to ask when looking for 10.0.2.15. This is the hardest part. You could try adding a special route rule on the other computer, to set the host as a gateway for 10.0.2.15, but it requires you to make this on every machine that wishes to access the VM.
As Ahmed said, the easiest way is probably to use a network bridge, where the virtual machine will act as any other computer on the network, with a visible IP.

Local DNS in a standard DHCP LAN

Our customers are typical broadband home users, with a DSL Modem/Router which offers DHCP.
We want our device which is connected to the home LAN and has an embedded HTTP Server to be addressable with a domain name (www.mydevice.ip or something). In particular, we want to avoid that the user has to get the IP address and type it into the address bar of his browser.
What solutions are available?
Has the typical DHCP Modem a DNS included - how do you use it?
Could other services offer help (eg. Bonjour)?
You can use mDNS/DNS-SD using "avahi" daemon -- this should work on mac + linux hosts, and maybe for windows.
For Windows, you can set up SAMBA to get WINS name resolution.
A "typical DHCP Modem" is no standard so there is no default answer.
What you want, is that the modem works as a DNS cache (which is pretty much the default) and additionally add your own, static DNS entries that point to the IP of the entry.
How you achieve that depends on the router...

Web Access to Virtual Machine

Is their a way to access a web server such as windows server 2003 installed on a virtual box such as vmware from the host machine?
If VMware is set to use bridged networking, then each guest OS effectively has its own IP address, like brien said, you just point your browser to that address.
If you configure your virtual machine to use bridged networking, instead of NAT, it will have its own IP address "beside" the host machine, instead of a local IP address "behind" it. Then you can connect to the virtual machine, using that IP number.
(Disclaimer: I've used VMware workstation for several years, but not their server products.)
Yes, you should just be able to point to the IP address of the VM.
How is your VM networking configured?
I am doing this all over the place, just make sure that the vm has an ip configured.
i believe vmware (workstation?) also has built in a virtual network client (VNC) that you can connect to - enable it by going to the configuration properties of the vm, and in the last tab there is a checkbox for it.
IP address should do it.
I faced the same issue. You have to set your networkconnection to "bridged mode" in your VM. Then you have to find out the IP of your Webserver.
Sometimes Webservers have a redirect to a specific URL. In this case you can edit your host-file in C:/Windows/System32/drivers/etc/hosts and add your IP with the redirected URL like this:
192.168.0.37 some.url-you.need
Then your Host can go to the Webserver. Even participants of your Ethernet can access the Webserver.

Resources