MERIDIAN DATA SYSTEMS // SYSTEM

networking

DOCUMENT TYPE: SYSTEM REFERENCE NODE: networking 68 DOCUMENTS
MDS://KNOWLEDGE/SYSTEM/networking
NETWORKING
==========

Network settings belong to the current virtual computer. You can inspect
interfaces, assigned IPv4 addresses, and routes, or configure them with the
ip command. Use addresses and gateways assigned for this computer.

INSPECT SETTINGS
----------------
    ip link
    ip addr
    ip route

ip link shows available interfaces and whether each is up. ip addr shows
assigned IPv4 addresses in CIDR notation. ip route shows connected networks
and configured routes.

CONFIGURE AN INTERFACE
----------------------
Local root is required to change network settings. Replace the placeholders
with an interface name and values assigned for the computer:

    ip link set dev <interface> up
    ip addr add <IPv4>/<prefix> dev <interface>
    ip route add default via <gateway> dev <interface>

To remove settings, use ip addr del <IPv4>/<prefix> dev <interface>,
ip route del <network>/<prefix>, or set the interface down with:

    ip link set dev <interface> down

Routes require a usable address on the selected interface. A gateway must be
on one of that interface's assigned subnets. Interface state, addresses, and
routes are saved with the virtual computer.

PACKET FORWARDING
-----------------
Read the forwarding setting with:

    sysctl net.ipv4.ip_forward

Local root can set it to 0 or 1:

    sysctl -w net.ipv4.ip_forward=0
    sysctl -w net.ipv4.ip_forward=1

Forwarding allows a virtual computer to pass packets between its interfaces
using its routes. Enable it only when that computer is intended to route
traffic.

These commands change simulated network state only; they do not configure the
host computer or access real networks.