Forbes India Leader Recognition
e.preventDefault(); // Prevent form submission input.blur(); // remove focus input.value = ""; // optional: clear the input

What is a Bastion Host?

What is a Bastion Host?

Featured Image

Tudip

A bastion host is a special purpose computer on a network that is deliberately exposed to a public network and configured to withstand attacks. From a secured network perspective, it is the only node exposed to the outside world and is thus very prone to attack. Usually a single application is hosted by the computer, for example, a proxy server, and all other services are removed or limited to reduce the threat to the computer.

What is the purpose of a bastion host?

By using a bastion host, you can connect to instances that do not have an external IP address associated with it. This approach enables you to connect to a development environment or for the management of the database instance for your external application, for example, without configuring additional firewall rules.

Domain name system, Web and File Transfer Protocol (FTP) servers. Firewalls and routers can also become bastion hosts are the common uses of Bastion Host.

Additionally, the best practice for an infrastructure administration is to limit access to the resources. This is where Bastion Host comes into the play, by allowing only itself to be communicated to the public network and restricting the public access to all the other resources which are in the same VPC (Virtual Private Cloud) network. Bastion Host connects to all the other resources via internal IP address as a perk of residing into the same VPC network along with other resources which can be a database, a firewall or another private server instances.

Creating a Bastion Host configuration

You can connect to an instance that does not have an external IP address with the help of Bastion host. This approach enables you to connect to a development environment or manage the database instance for your external application, for example, without configuring additional firewall rules.

Launch a sample webserver instance

Execute gcloud command to launch a private instance from the cloud shell and append –no-address to restrict the public access to this instance

gcloud compute instances create webserver 
--zone=us-central1-a 
--machine-type=f1-micro 
--no-address 
--image-family=debian-9-stretch-v20190326 
--image-project=debian-cloud 
--boot-disk-size=10GB 
--boot-disk-type=pd-standard 
--boot-disk-device-name=webserver

Create a Bastion Host

Execute gcloud command to launch Bastion Host instance from the cloud shell

gcloud compute instances create bastion 
--zone=us-east1-b 
--machine-type=f1-micro 
--tags=bastion 
--image-family=debian-9-stretch-v20190326 
--image-project=debian-cloud 
--boot-disk-size=10GB 
--boot-disk-type=pd-standard 
--boot-disk-device-name=bastion

Restrict firewall rule settings for SSH

The default setting for default or auto-type network is to allow SSH access from any source IP address. Create a new firewall to restrict access to just your source IP address.

gcloud compute firewall-rules create bastion-ssh 
--direction=INGRESS 
--priority=1000 
--network=data 
--action=ALLOW 
--rules=tcp:22 
--source-ranges=[YOUR IP HERE]/32 
--target-tags=bastion

Create a Firewall rule to allow traffic from the bastion to all other instances

gcloud compute 
--project=myproject firewall-rules create bastion-fwd 
--direction=INGRESS 
--priority=1000 
--network=data 
--action=ALLOW 
--rules=all 
--source-tags=bastion

Connect to the Bastion Host via SSH and verify access to webserver

In order to connect to the webserver instance, SSH into the bastion instance and then execute the command “ssh -a webserver”, on executing this command you will be able to connect to webserver instance even though the external IP of the instance is not reachable .

Related Posts

Latest Posts

  • All Posts
  • AI Powered Knowledge
  • ai/ml
  • CEO India Magazine
  • CMMI level 5 Certification
  • e-learning
  • Fintech
  • gaming
  • Generative AI
  • healthcare
  • manufacturing
  • News
  • OTT
  • Portfolio
  • supply chain
  • travel and hospitality
  • Tudip's AI Hackathon
  • Voxlearn Enterprises
    •   Back
    • Android
    • iOS
    • Java
    • PHP
    • MEAN
    • Ruby
    • DotNet
    • IoT
    • Cloud
    • Testing
    • Roku
    • CMS
    • Python
The Future of Workplace Learning: AI-Powered Knowledge on Demand

The Future of Workplace Learning: AI-Powered Knowledge on Demand

June 12, 2026

A few months ago, I was sitting in a meeting with a team lead who looked genuinely frustrated. Not because…

Read More
We Did It Again: Tudip Successfully Renews Its CMMI Level 5 Certification

We Did It Again: Tudip Successfully Renews Its CMMI Level 5 Certification

June 9, 2026

Nobody around here needed a memo to know something worth celebrating had happened. The message from the CMMI Institute said…

Read More
CEO India Magazine Features Dipti Agrawal: The Woman Behind Intelligent Enterprise Solutions

CEO India Magazine Features Dipti Agrawal: The Woman Behind Intelligent Enterprise Solutions

June 9, 2026

There are moments at work that just stop you in your tracks. Not the big quarterly reviews or the product…

Read More

India

Plot No. 11/2, Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, India – 411057.
info@tudip.com
+91-96-8990-0537

United States

1999 S. Bascom Ave Suite 700, Campbell CA. 95008, USA.
info@tudip.com
+1-408-216-8162

Canada

64 Caracas Road North York, Toronto Ontario M2K 1B1, Canada.
info@tudip.com

Mexico

Calle Amado Nervo #785 Interior B Colonia Ladron De Guevara 44600 Guadalajara, Jalisco, Mexico.
info@tudip.com

Singapore

77 High Street, #10-12B High Street Plaza, Singapore 179433.
info@tudip.com

Colombia

Cra. 9 # 113-53 Of. 1405 Bogotá D.C., Colombia.
info@tudip.com

UAE

Tudip Information Technologies L.L.C Office No 109, ABU HAIL BUILDING 13, Abu Hail, Dubai, UAE.
info@tudip.com

Nigeria

22 Kumasi Crescent, Wuse 2, Abuja, Nigeria.
info@tudip.com