...
Code Block | ||
---|---|---|
| ||
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:16:3c:3f:68:7f
inet addr:64.73.220.110 Bcast:64.73.220.255 Mask:255.255.255.0
inet6 addr: fe80::216:3cff:fe3f:687f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1677062 errors:0 dropped:952 overruns:0 frame:0
TX packets:11659 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88552695 (88.5 MB) TX bytes:2706451 (2.7 MB)
# you will see more but ignore
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# get gateway
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 64.73.220.1 0.0.0.0 UG 0 0 0 eth0
10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 lxcbr0
64.73.220.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
# Get name servers,
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 216.15.129.205
nameserver 216.15.129.206 |
Key things to note is your ethernet card device name (usually eth0), mask, gateway and gatewayname servers. In this example,
Network Attribute | Value |
---|---|
ethernet card device | eth0 |
mask | 255.255.255.0 |
gateway | 64.73.220.1 |
name servers | 216.15.129.205 |
Temporary to Test
You may use the ifconfig or ip command. I like the ifconfig as you do not need to calculate the netmask from Dotted Decimal to Bitmask (Bits). I also noticed a difference between the two commands. With the ifconfig, a brd number is added. I have no idea what the brd number is used for. Both approaches do work.
...