diff --git a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/code b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/code index d4658fe..6e1e38a 100644 --- a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/code +++ b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/code @@ -1 +1 @@ -ifconfig \ No newline at end of file +ifconfig -a diff --git a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/codeanswer b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/codeanswer index 57f1941..2ed6e98 100644 --- a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/codeanswer +++ b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/codeanswer @@ -1 +1,16 @@ -df -h \ No newline at end of file + +echo "Try" + +for i in $(ip -o link show | awk -F': ' '{print $2}'); \ +do mac=$(ethtool -P $i) \ +&& printf '%-10s %-10s\n' "$i" "$mac"; \ +done + +echo "OR" + +ls -l /sys/class/net/ + + +echo "So, actual devices show in /sys/class/net. Note that aliases (like lan:0) do not (so you can tell which are aliases). " + +echo "And you can clearly see which are actual hardware (lan) and which aren't (br0, lo, tun0)." diff --git a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/info b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/info index 8249367..db251ae 100644 --- a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/info +++ b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/info @@ -1,4 +1 @@ -INFO: Task Name - -*Asciidoc Task description* - +Display the configuration of all interfaces, both active and inactive. diff --git a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/q-info b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/q-info index 3d02dfc..c1f1d71 100644 --- a/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/q-info +++ b/llllllllllllllllll/0_nnnnnnnnnnnnnnnnnnnnnnnn/q-info @@ -1 +1 @@ -Find which specific ethernet device corresponds to a specific port +Find if a network interface is physical (device) or virtual (alias)? diff --git a/llllllllllllllllll/intro b/llllllllllllllllll/intro index ed98ec7..de1ebad 100644 --- a/llllllllllllllllll/intro +++ b/llllllllllllllllll/intro @@ -1 +1,47 @@ -intro ontro \ No newline at end of file +ifconfig stands for "interface configuration." + +It is used to *view and change the configuration* of the network interfaces on your system. + +Running the ifconfig command with no arguments, like this: + + +[source,bash] +---- +ifconfig +---- + +...displays information about all network interfaces currently in operation. The output will resemble the following: + + +[source,bash] +---- + +eth0 Link encap:Ethernet *HWaddr* 09:00:12:90:e3:e5 // <1> + inet addr:192.168.1.29 Bcast:192.168.1.255 Mask:255.255.255.0 + inet6 addr: fe80::a00:27ff:fe70:e3f5/64 Scope:Link + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:54071 errors:1 dropped:0 overruns:0 frame:0 + TX packets:48515 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:22009423 (20.9 MiB) TX bytes:25690847 (24.5 MiB) + Interrupt:10 Base address:0xd020 +lo Link encap:Local Loopback // <2> + inet addr:127.0.0.1 Mask:255.0.0.0 + inet6 addr: ::1/128 Scope:Host + UP LOOPBACK RUNNING MTU:16436 Metric:1 + RX packets:83 errors:0 dropped:0 overruns:0 frame:0 + TX packets:83 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:7766 (7.5 KiB) TX bytes:7766 (7.5 KiB) +---- +<1> *HWaddr* This is your MAC address +>1> *eth0* is the first Ethernet interface. (Additional Ethernet interfaces would be named *eth1,* *eth2,* etc.) This type of interface is usually a NIC connected to the network by a category 5 cable. +<2> *lo* is the loopback interface. This is a special network interface that the system uses to communicate with itself. + + + +*Configuring an interface* + +ifconfig can be used at the command line to configure (or re-configure) a network interface. + +This is often unnecessary since this configuration is often handled by a script when you boot the system. If you'd like to do so manually, you will need superuser privileges, so we'll use sudo again when running these commands.