syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

You are here: Linux101 > linux101_cclud_ip
Question:
In Linux101 how to CCLUD Linux IP address?

Q: Which CCLUD verbs apply to IP address?
A: I can only think of one which is List.
I only want to know which IP addresses are available for me to use, and which ones I'm using.
Also I want to know which interfaces my IP addresses are attached to.

Now, I should talk about 'interfaces' which are tangible objects I can CCLUD and are closely related to IP addresses.

An example of an interface is a port on the side of my laptop which takes a CAT5 cable.

A Linux instance is like a building with several mailboxes.
A Linux interface is like a mailbox.
We have differences though.
Usually I can see a mailbox.
I can see some Linux interfaces on the side of my laptop.
Some Linux interfaces (WIFI for example) are invisible.

So obviously a Linux instance can have several interfaces like a building can have several mailboxes.
Both a mailbox and interface become useful after I write an address on them.
An interface needs an IP address.
Based on this analogy it is now easy to understand some simple mistakes:
  • Interface with no IP address
  • One IP address written on more than one interface
  • Sending packet to IP address with no interface
  • Assign wrong IP address to wrong interface

Q: What is the loopback interface?
A: Linux uses it to talk to itself.
Q: What is the IP address of loopback interface?
A: 127.0.0.1

Q: For an interface, which are the most interesting CCLUD verbs?
A: List and Update.

Q: How to update an interface so it has an IP address?
A1: On any Linux which gives me access to the 'desktop', I right click on the network indicator in the upper right and then I click edit connections. From there I pick an interface I want to use. On a laptop that is usually the WIFI interface or the cable interface.
Finally, I choose an unused IP address and attach it to the interface and then the address switches state to 'in-use'.
For most users this process is a bit much to ask.
So, we have a technology named DHCP which automates the task of attaching an unused IP address to the interface(s) of your Linux instance(s).
A2: Another way to deal with this chore is to use a command line utility called ifconfig.
If I type in the one word command it gives me useful information about my Linux instance:
dan@feb ~/x611 $ 
dan@feb ~/x611 $ 
dan@feb ~/x611 $ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:9f:03:0b  
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe9f:30b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:927345 errors:0 dropped:0 overruns:0 frame:0
          TX packets:568568 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:552790807 (552.7 MB)  TX bytes:64899031 (64.8 MB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:cf:cc:a0  
          inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fecf:cca0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:577196 errors:0 dropped:63 overruns:0 frame:0
          TX packets:623504 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:153700631 (153.7 MB)  TX bytes:294769204 (294.7 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:178589 errors:0 dropped:0 overruns:0 frame:0
          TX packets:178589 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:147463689 (147.4 MB)  TX bytes:147463689 (147.4 MB)

dan@feb ~/x611 $ 
dan@feb ~/x611 $ 


ifconfig tells me that I have 3 interfaces: eth0, eth1, and lo.

Also I see that each interface has an IP address:

eth0 has 10.0.2.15
eth1 has 192.168.1.117
lo   has 127.0.0.1



A3: On any Linux running on the cloud IP address administration is simplified by the cloud provider.
On the cloud your instance will usually have two interfaces.
One interface will connect to the internet. If that interface is turned on and if it has an IP address, anyone can connect to it.
The second interface usually connects to an internal network.
The purpose of the second interface is to help you build a cluster of Linux instances which communicate over the internal network.
Also you might use this second interface to connect to services supplied by the cloud provider like network storage.
For both these types of interfaces, the cloud provider handles the chore of assigning IP addresses.

CCLUD of Linux Disk Space is the next topic of Linux101:
linux101_cclud_disk


You are here: Linux101 > linux101_cclud_ip
syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me