TUT-012

Assign ip through CMD

netsh interface ipv4 show interfaces

PublishedAug 10, 2026 Read time3 min Views0 Category Networking Tags
  1. Open Command Prompt as Administrator.

  2. To see your network adapters:

netsh interface ipv4 show interfaces

Idx Met MTU State Name


12          25        1500  connected     Ethernet
  1. Assign a static IP, subnet mask, and gateway:

    netsh interface ip set address name=“Ethernet” static 192.168.1.100 255.255.255.0 192.168.1.1

    • 192.168.1.100 → your IP
    • 255.255.255.0 → subnet mask
    • 192.168.1.1 → default gateway
  2. Set DNS: netsh interface ip set dns name=“Ethernet” static 8.8.8.8 netsh interface ip add dns name=“Ethernet” 8.8.4.4 index=2

    ipconfig /all ========================================================================================

🐧 Linux (Terminal)

sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up sudo route add default gw 192.168.1.1 eth0

For permanent assignment (Ubuntu with Netplan): Edit config file:

sudo nano /etc/netplan/01-netcfg.yaml yaml network: version: 2 ethernets: eth0: addresses: [192.168.1.100/24] gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8,8.8.4.4]

Apply:

sudo netplan apply
Share: Share on Facebook

// Related posts

// Comments (0)

No comments yet. Be the first.