Configuring routes in Linux/Windows and changing priority of route by changing metric(Windows)

LAB
Test Web Server
Company Web Server

1. Windows:

(A) Adding Routes

route print
Routing table
route ADD <destination_network> MASK <subnet_mask>  <gateway_ip> metric_costroute ADD 192.168.222.0 MASK 255.255.255.0 10.175.34.1
Newly added route
Secret Web server

(B) Changing priority of routes by changing metric

get-wmiobject win32_networkadapter | select netconnectionid, name, InterfaceIndex, netconnectionstatusnetsh interface ipv4 show interfacesGet-NetAdapter
Set-NetIPInterface -InterfaceIndex 12 -InterfaceMetric 15

(C) Disabling priority of ethernet interface(Prevents Wi-Fi disconnection after connecting Ethernet)

2. Linux:

route
routing table
ip route add 192.168.222.0/24 via 10.175.34.1
Adding new route
route del -net 192.168.222.0 gw 10.175.34.1 netmask 255.255.255.0 dev eth0

--

--

--

Geek👾. Tries to understand how computers work. Would love to hear your suggestions and feedbacks. https://www.linkedin.com/in/pswalia2u/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

OS USED IN DATA CENTERS

Insertion in BST | Rust

How to Sell Memberships to Your Telegram Group

How to Create a Serverless GraphQL API for MySQL, Postgres and Aurora

Exploring practical aspects of null checking in Kotlin

Three and a half ways with Lamba and VPC.

Creating Instances with Multiple Network Interfaces and IP route issue on Google Cloud Platform

If you’re a sysadmin who spends a lot of time staring at that black and white screen having opened…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
n00🔑

n00🔑

Geek👾. Tries to understand how computers work. Would love to hear your suggestions and feedbacks. https://www.linkedin.com/in/pswalia2u/

More from Medium

How to export — import a WSL Linux instance

How to ssh into GCP using Windows Terminal

CS-MalQuery — Part 2

Introduction to Firewalls

Image of a fire and wall which concludes firewall from the Panda Security website.