• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

network

Migrate VM to Other Network

July 20, 2021

Here’s how to move a VM to another network.

Stop the VM.

gcloud compute instances stop server-name \
--zone=us-central1-c \
--project project-id

gcloud compute instances stop server-name \ --zone=us-central1-c \ --project project-id

Migrate the VM. Use self link for network and subnetwork.

gcloud compute instances network-interfaces update server-name \
--zone=us-central1-c \
--network-interface=nic0 \
--network=your-network \
--subnetwork=your-sub-network \
--project project-id

gcloud compute instances network-interfaces update server-name \ --zone=us-central1-c \ --network-interface=nic0 \ --network=your-network \ --subnetwork=your-sub-network \ --project project-id

Start the VM.

gcloud compute instances start server-name \
--zone=us-central1-c \
--project project-id

gcloud compute instances start server-name \ --zone=us-central1-c \ --project project-id

Filed Under: Cloud Tagged With: compute, gcloud, gcp, instance, move, network, network-interface, start, stop

GCP Reserve Alias IP

June 13, 2021

Make an IP alias reservation.

gcloud compute instances network-interfaces update instance-name \
--zone us-central1-c \
--aliases default:/32 \
--project project-id

gcloud compute instances network-interfaces update instance-name \ --zone us-central1-c \ --aliases default:/32 \ --project project-id

Filed Under: Cloud Tagged With: aliases, compute, gcp, network, update

GCP Add New Route

March 2, 2021

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

AWS Enable Enhance Network Support

October 13, 2020

When changing machine types, you may be asked to enable the latest ENA driver for Enhanced Network Support on an Amazon EC2 instance. There are several instructions depending on the Linux OS flavor. Here are the instructions to enable. In some cases, you may need to rebuild the kernel module. To verify that the ena module is installed, use the modinfo command as shown in the following example.

modinfo ena

modinfo ena

You also may have to enable the enhanced networking attribute on the instance.

aws ec2 modify-instance-attribute --instance-id instance_id --ena-support

aws ec2 modify-instance-attribute --instance-id instance_id --ena-support

Filed Under: Cloud Tagged With: aws, ec2, ena, enable, enhanced, modinfo, network, support

Nmap

March 19, 2020

Here’s how to list all the devices on your network using nmap.

nmap -sn 192.168.0.0/24

nmap -sn 192.168.0.0/24

If nmap is not installed, install it.

yum install nmap
apt install nmap

yum install nmap apt install nmap

Filed Under: Linux Tagged With: devices, install, network, nmap

Netstat

March 3, 2020

Netstat is a utility for gathering network statistics. It comes preinstalled on most systems.

If missing, here’s how to install.

# Redhat, CentOS
yum install net-tools
# Debian, Ubuntu, Mint
apt install net-tools
# SLES, SUSE
zypper install net-tools

# Redhat, CentOS yum install net-tools # Debian, Ubuntu, Mint apt install net-tools # SLES, SUSE zypper install net-tools

Here are some common and useful commands.

# show version
netstat -v
# show routing table
netstat -nr
# show network interface statistics
netstat -ai
# show network connections
netstat -ant
# show network services
netstat -tulpn

# show version netstat -v # show routing table netstat -nr # show network interface statistics netstat -ai # show network connections netstat -ant # show network services netstat -tulpn

Filed Under: Linux Tagged With: interface, netstat, network, routing, services, statistics, version

GCP ILB Issue Targets Not Healthy

January 14, 2020

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

SCP

January 6, 2020

SCP is similar to the CP or copy command, but it’s done via a secure network.

Here’s a CP command.

cp /dir1/filename /dir2

cp /dir1/filename /dir2

You can use SCP to copy file to another system. It requires login.

scp /dir1/filename user@server:/home/user

scp /dir1/filename user@server:/home/user

This is using SCP to copy a file from 2 remote systems.

scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2

scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2

Filed Under: Linux Tagged With: cp, ftp, login, network, scp, secure

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023