02 - NIC Configuration

Networking Review

Layer# Layer name PDU Description Examples of Protocols
7 Application Data Network Process to Application DNS, FTP, HTTP, Telnet, DHCP
6 Presentation Data Data Representation and Encryption GIF, JPEG, SSL, MIME
5 Session Data Interhost Communications NetBIOS, Sockets, Named, Pipes, RPC
4 Transport Segment End-to-End Connections and reliability TCP, UDP
3 Network Packet Path Determination IPv4, IPv6, IPsec, BGP, ICMP, IGMP
2 Datalink Frame Physical Addressing Ethernet, MAC, Wifi, LLC
1 Physical Bits Mediums, signals, and binary transmission Cat5e, Fiber, Wireless

Networking on Server vs. Client

Network interfaces and Naming in Linux

Network Renderer in Linux

Systemd-networkd

Network Manager

Network Config in GUI

Network Configuration in CLI

ip Command

Note: ifconfig is deprecated. You can still install ifconfig utility manually in Ubuntu via ethtools package

ip Command Structure (how to use)

  1. Call the IP command (i.e. ip or sudo ip)
  2. Then use sub-commands to target protocol/layer:
    • address (Layer 3)
    • link (layer 2, physical interface itself)
    • maddr (layer 3, Multi-cast address)
    • neigh (layer 2, ARP tables)
    • route (layer 3, route tables)
  3. Then use show or modifying sub-commands:
    • show
    • add, del, set
  4. Target specific device or interface
    • dev <interface>
      0d6090059dbd4d03a0807643df4613c4.png

Here is a nice IP Command Cheat Sheet from RedHat: https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf

Netplan for Persistent Configuration

YAML Config File

# <- this is a comment
# Blank space indicate indentation (use space bar to insert appropriate number of them)!
network:
    version: 2      # We only use version: 2 
    renderer: <renderer name>     # use “networkd” or “networkmanager”
    ethernets:
       <device_name>:      # Use `ip addr show` to get the logical name of the interface (examples: eth1, ens33, or ens34) Or use `lshw –class network`
         dhcp4: <true/false>
         addresses: [<IP>/<mask>]
         gateway: <Gateway_IP>
         nameservers:
            addresses: [<DNS_IP_1>,<DNS_IP_1>]
# <- this is a comment
# Blank space indicate indentation (use space bar to insert appropriate number of them)!
network:
    version: 2      # We only use version: 2 
    renderer: <renderer name>     # use “networkd” or “networkmanager”
    ethernets:
       <device_name>:      # Use `ip addr show` to get the logical name of the interface (examples: eth1, ens33, or ens34) Or use `lshw –class network`
         dhcp4: <true/false>
         addresses: [<IP>/<mask>]
         gateway: <Gateway_IP>
         nameservers:
            addresses: [<DNS_IP_1>,<DNS_IP_1>]

Interesting Files, Utilities, and Commands