• Skip to main content

Uly.me

cloud engineer

  • Home
  • Archives
  • Search

route

GCP Add New Route

March 2, 2021 by Ulysses

Here’s how to add a new route in Google Cloud Platform.

gcloud compute routes create name-of-new-route \
  --destination-range=200.20.0.0/15 \
  --next-hop-gateway=default-internet-gateway \
  --project=host-project \
  --network="default" \
  --priority=900

gcloud compute routes create name-of-new-route \ --destination-range=200.20.0.0/15 \ --next-hop-gateway=default-internet-gateway \ --project=host-project \ --network="default" \ --priority=900

Filed Under: Cloud Tagged With: add, default, gateway, gcp, network, new, route

GCP ILB Issue Targets Not Healthy

January 14, 2020 by Ulysses

I ran into an issue with Google Compute Engine TCP internal load balancer. The targets are unhealthy although all configs were correct installed. At one time the targets were working, but somehow they became unhealthy. In the end, 3 things needed to be checked.

  1. Make sure GCP’s guest environment is installed.
  2. Add the internal load balancer VIP address to the network properties.
  3. Add route via cmd. “route ADD VIP MASK 255.255.255.255”

You will need to change the server’s IP from DHCP to static to add ILB VIP.

Filed Under: Cloud Tagged With: add, cmd, environment, gcp, guest, internal, load balancer, network, properties, route, vip

Windows Route Add

January 14, 2020 by Ulysses

Here’s how to add a route in Windows. Open CMD as Administrator.

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

To make it persistent, add -p.

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

route add 10.10.10.10 mask 255.255.255.0 10.10.10.254

To display. Specifies IP 4 only.

route print -4

route print -4

Filed Under: Windows Tagged With: add, display, permanent, persistence, print, route, server, windows

GCP Load Balancer Local Routing Table

July 29, 2019 by Ulysses

Test if the GCP Load Balancer is working by sending a curl command from the backend VM.

Assume the load balancer IP address is 10.1.2.99, and the VM is called vm-a1.

curl http://10.1.2.99

curl http://10.1.2.99

The end result is …

Page served from: vm-a1

Page served from: vm-a1

Make sure there’s an entry in the local table that matches the IP of the load balancer.

ip route show table local | grep 10.1.2.99

ip route show table local | grep 10.1.2.99

If not, add it.

ip route add to local 10.1.2.99/32 dev eth0 proto 66

ip route add to local 10.1.2.99/32 dev eth0 proto 66

Documentation

Filed Under: Cloud, Linux Tagged With: curl, gcp, load balancer, local, route, table

AWS EC2 Enable Secondary IPs

July 25, 2019 by Ulysses

Here’s how to enable secondary private IPs for AWS EC2 instances.

  1. Add secondary private IPs to the instance.
    • Editing the instance Networking > Manage IP Addresses.
    • Add new private IP addresses.
    • Save.
  2. Set the route configuration for each secondary IP address.
    • Config files are ifcfg-eth0:0, ifcfg-eth:0.1 and so on.
    • Test each interface or IP to see if they respond to ping.
    • /etc/sysconfig/network-scripts/

ifcfg-eth0:0

NM_CONTROLLED="no"
DEVICE="eth0:0"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="10.0.0.14"
NETMASK="255.255.255.255"

NM_CONTROLLED="no" DEVICE="eth0:0" ONBOOT="yes" BOOTPROTO="static" IPADDR="10.0.0.14" NETMASK="255.255.255.255"

ifcfg-eth0:1

NM_CONTROLLED="no"
DEVICE="eth0:1"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="10.0.0.15"
NETMASK="255.255.255.255"

NM_CONTROLLED="no" DEVICE="eth0:1" ONBOOT="yes" BOOTPROTO="static" IPADDR="10.0.0.15" NETMASK="255.255.255.255"

Filed Under: Cloud, Linux Tagged With: aws, ec2, ip address, network, private, route, secondary

  • Home
  • About
  • Contact

Copyright © 2022