How can I accessing a react app in Virtualbox - reactjs

Trying to connect to a react app that is running inside a Virtualbox wit Ubuntu 18.04.
Did the network config on virtualbox by adding a second network configured via NAT and added all my forwarded ports.
Ports forwarded:
Server ports listening:
Result when trying to connect to port:
My problem is that all the other ports that I am forwarding work perfectly except for 3000 or 3001, which are both react apps.
What am I doing wrong?

You should specify Host IP and Guest IP in port forwarding.
To define Guest IP you need to call ifconfig command via console and find inet addr. In my case it equals to 10.0.2.15.
Your Host IP is 192.168.0.6 based on the screenshot above.

Related

Unable to ping from GNS3 topology to Physical Adapter

I'm trying to setup a connection b/w GNS3 Router and Local PC. Following are the steps done so far in GNS3:-
1. setup a router interface, e0/0/ = 192.168.1.1 255.255.255.0
2. created a cloud loopback adapter, interface, and assigned IP = 192.168.1.5 255.255.255.0
(Note: loopback adapter has been created as Mictosoft KM-Test loopback on my PC. and same interface has been added to cloud in GNS3 which is then connected to Router interface, e0/0)
When I tried ping from my PC to GNS3 R, arp entries get created in Router (running on GNS3 topology). See below:
RTR#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.1.1 - aabb.cc00.0200 ARPA Ethernet0/0
Internet 192.168.1.5 134 0200.4c4f.4f50 ARPA Ethernet0/0
But ICMP isn't successful on Router (See below) :-
RTR#ping 192.168.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Can anyone help here pls ??
Try setting the IP address of the KM-Test adapter to an address outside your home network. Such as 10.0.0.1/24. Attach your cloud to the network adapter and then create persistent static routes by opening a command prompt as administrator and entering the command.
route -p add [Destination] mask [Subnet Mask] [Gateway(KM-Test)]
Note that any additional network you create within GNS3 will need a static route so that windows knows to send your packets through the KM-Test rather than your home network gateway.

Port forwarding issue

I have Totolink A2004NS wifi router, to which I have connected a desktop PC with static IP configured.
I have got the static IP address from the ISP. I need to host a web service on port 80.
When I try to port forward External port 80 to Internal port 80, I get a error message saying -
Port number can not contain Web port.
Screenshot attached.
However, other port forwards work just fine.
What am I doing wrong?
I had the same issue. If you change the web port of the wifi router from the WAN settings, you will be able to port forward to 80.

How to use local macbook server to allow multiple devices to view Reactjs page?

I have a local server running Reactjs on my Macbook. (newbie in React)
1) How could I change the http://localhost:4001 name to something else (e.g. http://www.test.com)
--> I'm using webpack-dev-server --port 4001
2) How could I allow up to 500 iOS/Android device to connect to this local server? (e.g do how to setup a router to broadcast this?)
--> Found this ReactJS-and-ngrok but not sure what's the concurrent users it's able to support.
3) How to allow the device to connect to a wifi without internet access?
First, see what IP is your Macbook in your local network. System Preferences->Network. Suppose your Macbook IP is 192.168.1.70 and your server is on 4001 port. Then you can start your webpack-dev-server with the following options: --output-public-path="http://192.168.1.70:4001/" --host="0.0.0.0" --public="192.168.1.70:4001". You can still access it via localhost name on Macbook, but on other devices use full IP + port number as address.
Can't say anything about setting domain... may be you can configure your router somehow? Sorry, newer had to face such a task

Public LAMP with a modem and router

I am using an Apache2 with a PHP and MySQL installed on Ubuntu. What I would like to do is to run the server public, to access it from outside my network.
However, I am having trouble configuring it, since I am using a ZyXEL P660HW-T3 v2 ADSL Modem with an IP 90.xxx.xxx.xxx together with an ASUS RT-N16 Wi-Fi router with the LAN address 192.168.1.1.
Could someone help me to set up the configuration file correctly to make the server public?
You need to configure your router to forward port 80 from the WAN interface to 192.168.1.1.

How to connect socket via external IP (Mac )

My question is, how to connect to socket on romote mechine?
I can only connect sockets on same network..
I wrote a simple code (in c), that simulate a server (open socket and listen for client). in Mac.
I'm trying to connect this socket as a client from iPhone (with simple objectiv-c code).
If my internet on both, server and client, is on the same network (WiFi) and in client I trying to connect to 192.168.1.x, it's working.
But when, in client, I'm trying to connect via external IP (with the same port) connection is failed.
I never did this bofore. Maybe I miss somthing.. I've tried to turn my FireWall off. It did not help.
Thanks.
Edit: If it's not clear.. my Mac is connected by router.
In a setting like this, the "external IP" would typically be the IP of the router. In all likelihood you'll need to configure the router to forward the relevant port to the internal IP address.
It could also be the case that for the port forwarding to work, the request has to come in on the external (WAN) interface. This depends on how the router is configured. If that's the case, you'll need to make sure that you're accessing the external IP via the cellular network and not the Wi-Fi connection on your iPhone.
If you're connecting to your server via a local IP address (i.e., you're connecting to another machine on the same local router via a delegated DHCP address), then your issue is on the network, not the IP-stack of the local machine.
You'll need to look into your router settings ... many routers will block a number of services, especially those on custom ports, in order to prevent malicious attacks from sources external to the local network.

Resources