Elastic D&D - Update 7 - Port Forwarding
Tags: network, networking
Published: 2023-10-07 17:17:55

Last week we talked about moving to a docker implementation. If you missed it, you can check that out [here](https://dev.to/thtmexicnkid/elastic-dd-week-6-docker-implementation-2n71)!

## Port Forwarding
Port Forwarding is the process of allowing remote devices to connect to local devices by means of network redirection via a router or firewall.

As far as for Elastic D&D, this process is necessary to expose both Kibana and Streamlit to the internet so my group members in other countries can still use the application. In my use-case, all configuration is done in my router settings.

### How-To
_**IMPORTANT**_:
> This may be specific to my router. Your settings may be in a different menu, called something completely different, etc. Please be mindful of that!

* Find your default gateway address
Open Command Prompt, run "ipconfig", and grab your "default gateway" address. This should allow you to log into your router.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ioqz2yzj9hm4p4u7wzj.png)

* Open a web browser and navigate to your default gateway address
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sfn873ae38sdv98sauo5.png)

_**NOTE**_:
> You may need a password to access your router settings or certain menus. You can usually find this on the back of your router.

* Navigate to port forwarding settings
Per my router, port forwarding settings are under Firewall -> NAT/Gaming.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65dlq1bq72rf017fw7g3.png)

* Configure port forwarding for both Kibana and Streamlit
Per my router, I set up a service entry for both Kibana and Streamlit...
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yj8kg3gxa7btpaf8znyq.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdpsuivf6hmb7mbjcwyh.png)

...and then pointed the service applications to my device.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5pgoy7ohdiuty4w4tr8.png)

* Access the applications via your public IP address
I found my public IP address via [https://www.whatismyip.com/](https://www.whatismyip.com/).

Kibana can now be accessed by remote machines at http://PUBLIC_IP:5601

Streamlit can now be accessed by remote machines at http://PUBLIC_IP:8501

_**NOTE**_:
> This is only for remote access. If you are trying to access the application from the local network, you need to use "localhost" instead of the public IP. I learned this the hard way...for almost 3 weeks.

## Closing Remarks
This part took a very long time because, as I mentioned above, I was testing from my local network instead of remotely. Definitely a lesson learned.

I also got the chance to rewrite the entire Streamlit app to utilize pages! This allowed me to proceed with Veverbot, your very own D&D AI assistant! Lots of cool stuff to talk about in the coming weeks.

Check out the GitHub repo below. You can also find my Twitch account in the socials link, where I will be actively working on this during the week while interacting with whoever is hanging out!

[GitHub Repo](https://github.com/thtmexicnkid/elastic-dnd)
[Socials](https://allmylinks.com/thtmexicnkid)

Happy Coding,
Joe