• Telecommunications Consulting

    Telecommunications Consulting

    Consulting Services from Network Design to Project Management Read More
  • Internetworking Training Experts

    Internetworking Training Experts

    Click on Training and then Courses. Read More
  • Wireshark Experts

    Wireshark Experts

    Packet analysis expertise is critical in today's networks, and being able to use the best packet analyzer application is a skill we can help you and your team attain. Read More
  • Are you a Network Scientist?

    Are you a Network Scientist?

    Online Learning, Instructor Led in person or Web-based delivery. Check out our online school. Read More
  • Online Certification Training

    Online Certification Training

    Find out about our Network Self Certification Program for Rural Service Providers here! Read More
  • IPv6 Experts

    IPv6 Experts

    Along with other Internet regions, ARIN is out of IPv4 Addresses. Are you IPv6 fluent? Are you IPv6 ready? Read More
  • Enabling the IoT with Wireless

    Enabling the IoT with Wireless

    Without wireless, we cannot have the Internet of Things. Read More
  • MPLS Book for iPad and iPhone

    MPLS Book for iPad and iPhone

    Get Mr. Walding's book here! Read More
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

Welcome to CellStream, Inc. - Telecom Consulting and Training!

Welcome to our home on the Internet, where we can not only share information, but also interact with each other. If you are a visitor to the site, there are a number of things to view: our FAQ'sNetworking and Computing Tips, our CellStream Blog, and other fun reading can all be found in the drop down menus above.  The Training menu provides access to our courses, our course calendar, and learning services.  The Consulting Menu provides information on our consulting services and a place to meet our consulting and teaching team.  Registered CellStream folks and our clients will log in using their private credentials to access projects, calendars and discussions.

Thanks for visiting! We always welcome comments and suggestions.

The following is a must have reference for Linux systems networking operations.  

We will be using the two basic commands: 'ifconfig' and 'ip'.  If you are the rtoot or administrator you should have no issues using the commands as shown.  If you do not, you may want to use 'sudo' in front of the commands shown.

View the Network Settings of all Interfaces on the System

Let's use the plain vanilla ifconfig command with no arguments in a terminal window first:

ifconfig 

linuxnet1

We see the network interfaces shown, with flags, MTU, address configuration (both IPv4 and IPv6), the MAC address, then some statistics (received and transmitted packets as well as associated errors).  When you run this command you may see more interfaces including your wlan interface.

The equivalent command using 'ip' is the 'ip addr show' command:

ip addr show

linuxnet2

View the Network Settings of a Specific Interface

To examine a specific interface, use the ifconfig with the name of the interface:

ifconfig eth0

linuxnet3

Using the ip command: 

ip addr show dev eth0

linuxnet4

You can see in the above command outputs that IPv6 addresses also exist.  You can check IPv6 by using the following command:

cat /proc/net/if_inet6

Here is the command to use ifconfig for IPv6:

ifconfig eth0 | grep "inet6 addr:"

I will try to inject IPv6 below, but there is a separate article on this here.

Enabling or Disabling a Network Interface

Using the term 'down' or 'ifdown' along with the interface name will disable the interface.  The opposite, 'up' will bring the interface back up.  The example below takes eth0 down and then brings it back up.  Note the ifconfig command is run after each to show the changes:

linuxnet5

With the ip command we use the link set command:

linuxnet6

Note the subtle differene that with the ip command you see the interface is "DOWN".

Statically Assigning an IPv4 or IPv6 Address to an Interface 

Normally your system will use DHCP (bootp) to acquire an IP address from the local DHCP server or router.  However, if you want to statically set the IP address, there are serveral ways.  Keep in mind that you may need to also set the network mask as well, so even though you can do these things one at a time, we show the methods for doing them all.

Using the ifconfig command we will use the following: 

ifconfig eth0 192.168.1.99 netmask 255.255.255.0 broadcast 192.168.1.255

linuxnet7

You can do each command one at a time as follows:

ifconfig eth0 192.168.1.99 
ifconfig eth0 netmask 255.255.255.0
ifconfig eth0 broadcast 192.168.1.255

To configure an IPv6 address using the 'ifconfig':

ifconfig eth0 inet6 add 2001:db8:1:1::1/64

Using the 'ip' command:

ip -6 addr add <ipv6address>/<prefixlength> dev eth0 

Another way to change the IPv4 address is to edit the following file: /etc/network/interfaces

We will use nano to do this (in terminal enter nano /etc/network/interfaces ):

 linuxnet8

 What we are going to do is ass the following text into the file:

# The Ethernet 0 network interface
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1

Your screen should look like this:

linuxnet9

Then save the file.  Check the file is as you want with the 'cat' command:

linuxnet10

OK, all looks good.  You will have to issue the following command to make the changes take effect:

/etc/init.d/networking restart

In some cases you will have to reboot.

Then the changes will be made:

linuxnet11

If you wanted to statically configure an IPv6 prefix, you can follow the same procedure with nano, except add the following lines editing to suit your needs:

# Ethernet 0 network IPv6 address
iface lo0 inet6 loopback iface eth0 inet6 static address 2001:db8:0:0::1 # replace with your static address netmask 64 gateway fe80::1 # replace with your gateway link local address

Again, you will have to restart the networking or the system to have these changes take effect.

Removing an IPv4 or IPv6 Address from a Network Interface

To remove an IPv4 address from the network interface using the 'ifconfig' command:

ifconfig eth0 del 192.168.1.100

To remove an IPv4 address from the network interface using the 'ip' command:

ip addr del <ipv4address> dev eth0

To remove an IPv6 address from the network interface using the 'ifconfig' command:

ifconfig eth0 inet6 del <ipv6address>/<prefixlength>

To remove an IPv6 address from the network interface using the 'ip' command:

ip -6 addr del <ipv6address>/<prefixlength> dev eth0

Changing the MAC Address of an Interface

Sometimes we need to spoof another MAC/machine, or just change our MAC to make it easy to filter packets if we are sniffing them.

To change the MAC address of an interface use this commend:

ifconfig eth0 hw ether DE:AD:BE:EF:CA:FE

Here is a before, a change and an after view:

linuxnet13

Enabling/Disabling Promiscuous Mode

Normal Ethernet behavior filters packets that arrive at your interface that are not destined for your MAC, a Multicast group that you belong to, or broadcast.  These packets are essentially politely dropped.  In most switched ethernet environments the ethernet switch does this also.

What if you wanted to allow any and all packets received without being filtered?  This is called promiscuous mode.  Turning it on is easy:

ifconfig eth0 promisc

Turning it off is also easy:

ifconfig eth0 -promisc

Try this and then use a packet capture (using a tool like Wireshark) to see if you notice a difference in your network.

Changing the MTU of an Interface

Normal ethernet has an MTU of 1500 bytes.  What if you want to run a network with bigger packets/frames?  First you will have to turn on 'jumbo frames' on all your switched ethernet interfaces (switches and routers).  Now you can increase the size of the MTU on the Linux system:

ifconfig eth0 mtu 2000

We have increased it to 2000 bytes above.

Want to make smaller packets/frames?  Just lower the number.  The problem here is that you will likel;y see slower throughput using smaller frames.

Checking the System Route Table

If you are a networking person, you know that every computer/system running Linux has a route table.  To display the route table use:

ip route show

linuxnet12

Another way to look at the routing table is with the 'netstat' command:

netstat -r  or  netstat -r -6

linuxnet14

 

We hope this helps as a reference for Linux networking commands to at least get you up to speed.

Comments?  Missing parts?  Let us know.

 

 

Comments powered by CComment

Our Latest Content

  • Linux Starting Point - Commands You Need To Know

    My recent blog post regarding Linux being the operating system of choice if you are supporting/testing/operating a network has spawned

    Read More
  • What is the 'cat' command, and how can I use it?

    The 'cat' [short for “concatenate“] command is one of the most frequently used commands in Linux and other operating systems. The

    Read More
  • IPv6 Settings (SYSCTL) on Linux

    Is there a simple way to display all the IPv6 settings on a Linux machine? Absolutely!  I have done the

    Read More
  • How to use Wireshark to capture between VirtualBox VM's

    A great question and problem. The fundamental answer is you can't.  Why?  Depends on who you believe.  My conclusion is

    Read More
  • Zenmap - the nmap GUI

    In our previous articles on nmap - we ran everything from the command line interface of various Linux distributions.  When you

    Read More
  • 1
  • 2
  • 3
  • 4

Our Most Popular Articles

  • What is the 'arp' command, and how can I use it?

    Let's answer the question.  If you want more details than what we have provided below, check out our chapter on

    Read More
  • Neighbor Discovery (ND) Table in IPv6 Windows, Linux and MAC Machines

    A great question I was asked in class was: "If Neighbor Discovery processes have replaced ARP in ICMPv6, how do

    Read More
  • IPv6 Windows Command Line Examples

    Here are some great Windows command line entries you can make to examine and configure IPv6 (assuming your version of

    Read More
  • How do I reset my "Default" profile in Wireshark?

    This is a commonly asked question that usually results from users learning the can have different profiles after they have

    Read More
  • A List of Network Monitoring Tools for Network and System Administrators

    Monitoring, analyzing, managing, and diagraming a network can often be a huge problem for Network and System Administrators.  They are

    Read More
  • 1
  • 2
  • 3
  • 4

Event Booking Mini Calendar

October   2018
S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Subscribe to our Newsletter!

Find by Tag

4G Networks 5G Networks 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az Ad-Hoc Addressing Analysis Ansible Apple Architecture ARP Assessment AToM Automation Baseline BGP Bloom's Taxonomy Bluehost BPF Briefings Cable Capture Filter cat CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud CMD Company Policy Computer Consulting Data Center Data Networking Dependencies DHCPv6 Display Filter DNS Documentation dumpcap Earth Earthquakes ECMP Ethernet Ethics Etiquette Evaluation Field Operations Five Monkey Rule G-MPLS Gauge GeoIP GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 India Internet IoT IPv4 IPv6 IRINN IS-IS L2VPN L3VPN LDP LifeNet Linux LLN LoL M-BGP MAC Macro Microsoft Milky Way mininet Monitoring MPLS mtr Multicast Murphy Name Resolution Netcat NetMon netsh Networking nmap NSE Observations OLPC Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Parrot PIM Policy POTS POTS to Pipes PPP Profile Project Management PW3E QoS QUIC Railroad Remote Desktop Requirements Resume Review RIP Routig Routing RPL RSVP Rural SDN Security Service Provider Small Business SONET Speed SSL Status Storms Subnetting Support SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone Testing Tools Traceroute Traffic Engineering Training Travel Tunnel Ubuntu Utility Video Virtualbox Virtualization VoIP VRF VXLAN Wi-Fi Windows Wireless Wireless 5G Wireshark WLAN Writing Zenmap ZigBee

Twitter Feed