network

get into

[!NOTE|label:references:]

  • [Ubuntu Linux view status of my network interfaces card])(https://www.cyberciti.biz/tips/ubuntu-linux-view-the-status-of-my-network-interfacescard.html)

get interface by command

  • list all interfaces

  • show active via nmcli

  • get status

get gateway

get ipv4 address

get ip address by hostname

get active IP address

get active Mac address

dig

get network speed

check remote server dns

show hardware spec

ethtool

list hardware

change interface name

[!NOTE|label:references:]

Permanent Solution

  • e.g.:

temporary Solution

  • e.g.:

show internet connection

tips

nginx

[!NOTE|label:references:]

PARAMETER
COMMENTS

-iL <inputfilename>

Input from list of hosts/networks

-iR <num hosts>

Choose random targets

-sL

List Scan - simply list targets to scan

-sP

Ping Scan - go no further than determining if host is online

-P0

Treat all hosts as online -- skip host discovery

-PS/PA/PU [portlist]

TCP SYN/ACK or UDP discovery probes to given ports

-PE/PP/PM

ICMP echo, timestamp, and netmask request discovery probes

-n/-R

Never do DNS resolution/Always resolve [default ⎮ sometimes resolve]

-sS/sT/sA/sW/sM

TCP SYN/Connect()/ACK/Window/Maimon scans

-sN/sF/sX

TCP Null, FIN, and Xmas scans

-sO

IP protocol scan

-sI <zombie host[:probeport]>

Idlescan

-O

Enable OS detection

scan 80 or 22 in particular setment

  • or

  • get down

route

iptables

[!NOTE|label:references:]

port forwarding

[!NOTE|label:references:]

port redirection

nslookup

  • or

  • or

traceroute

[!NOTE|label:references:]

traceroute for port

no route to host

[!NOTE|label:references:]

DNS

add new DNS permanently

wifi

iwconfig

  • installation

  • get wireless card

  • wireless network details

  • or

nmcli-1
  • show available wifi

nmcli-2
  • show saved wifi list

nmtui

nmtui-1
nmtui-2

netmask

[!NOTE|label:references:]

conversion

[!NOTE|label:references:]

basic concept

[!TIP|label:what is netmask] A netmask is a 32-bit binary mask used to divide an IP address into subnets and specify the network's available hosts.

  • full 32-bit :

  • sample data:

    • ip address: 10.0.0.0

  • 24-bit = 1x8x3 + 0x8 bit = 11111111 11111111 11111111 00000000

  • wildcard = 00000000 00000000 00000000 11111111 = 0x8x3 + 1x8 bit = 2^8 - 1 = 255 = support 255 IPs maximum including boardcast = support 255-1 regular IPs

==>

  • network : 10.0.0.0/24

  • hostMin : 10.0.0.1

  • hostMax : 10.0.0.254

  • boardcast : 10.0.0.254

  • host/net : 254

example

if netmask using n-bit, then supported hosts/nets = 2^(32-<n>) - 1 - 1. i.e.:

  • netmask : 27

  • supported IPs : 2^(32-27) - 1 - 1 = 2^5 - 1 - 1 = 32 - 2 = 30

  • IP ranges : 10.0.0.1 ~ 10.0.0.30

  • boardcast : 10.0.0.31

if netmask using 255.255.x.x

  1. convert netmask decimal to binary, and get bit and then get wildcard. i.e.:

  • netmask : 255.255.255.192

  • decimal to binary :

    [!TIP]

    192 = 128 + 64 = 2^7 + 2^6 =

  • netmask :

    = 1x3x8 + 1x2 + 0x6 = 26

  • wildcard :

    = 0x3x8 + 0x2 + 1x6 = 6 === 32 - 26 = 6

  • IPs : 2^6 - 1 - 1 = 64 - 2 = 62 = 10.0.0.1 ~ 10.0.0.62

  • boardcast : 10.0.0.63

  1. 255.255.255.255 - <netmask>, and then convert decimal to binary

  • netmask : 255.255.240.0

  • wildcard :

    [!TIP]

    255.255.255.255 - 255.255.240.0 = 0.0.15.255 =

  • IPs : 2^12 - 1 - 1 = 4094 =

  • boardcast : 10.0.15.255

# BITS
# HOSTS
NETMASK
CLASS

/4

268435456

240.0.0.0

A

/5

134217728

248.0.0.0

A

/6

67108864

252.0.0.0

A

/7

33554432

254.0.0.0

A

/8

16777216

255.0.0.0

A

/9

8388608

255.128.0.0

B

/10

4194304

255.192.0.0

B

/11

2097152

255.224.0.0

B

/12

1048576

255.240.0.0

B

/13

524288

255.248.0.0

B

/14

262144

255.252.0.0

B

/15

131072

255.254.0.0

B

/16

65536

255.255.0.0

B

/17

32768

255.255.128.0

C

/18

16384

255.255.192.0

C

/19

8192

255.255.224.0

C

/20

4096

255.255.240.0

C

/21

2048

255.255.248.0

C

/22

1024

255.255.252.0

C

/23

512

255.255.254.0

C

/24

256

255.255.255.0

C

/25

128

255.255.255.128

-

/26

64

255.255.255.192

-

/27

32

255.255.255.224

-

/28

16

255.255.255.240

-

/29

8

255.255.255.248

-

/30

4

255.255.255.252

-

/31

-

-

-

/32

1

255.255.255.255

-

[!NOTE|label:references:]

  • basic usage

    network detials
  • split network to subnets

    split to subnets
  • deaggregate address range

    ip range

Last updated

Was this helpful?