Interface Configuration
ip link set [interface] up/down
- Enables/disables network interface
ip addr add [ip/mask] dev [interface]
- Assigns IP address to interface
ip route add [network] via [gateway]
- Adds static route
Network Files
/etc/network/interfaces
- Main network configuration file
/etc/resolv.conf
- DNS resolver configuration
/etc/hosts
- Static hostname resolution
Service Management
systemctl restart networking
- Restarts network service
systemctl enable networking
- Enables networking at boot
ifup [interface]
- Brings interface up
ifdown [interface]
- Brings interface down
Verification
ip addr show
- Shows all interface IP addresses
ip route show
- Displays routing table
ping -c 4 [host]
- Tests connectivity (4 packets)
ss -tuln
- Shows listening ports
Example Config
|
|