Your SlideShare is downloading. ×
The ifconfig Command
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

The ifconfig Command

1,812
views

Published on

A look at this useful command for connecting your computer to a network

A look at this useful command for connecting your computer to a network

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,812
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ifconfig Kevin O'Brien Washtenaw Linux Users Group http://www.lugwash.org
  • 2. ifconfig ● ... stands for interface configurator ● ... is part of the original internet toolkit http://www.faqs.org/docs/linux_network/x- 087-2-iface.interface.html ● ... has versions available for Linux, BSD, Solaris, and Mac OSX 2
  • 3. man page ● Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. 3
  • 4. man page 2 ● If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface. 4
  • 5. Sample output eth0 Link encap 10Mbps Ethernet HWaddr 00:0F:20:CF:8B:42 inet addr 172.16.1.2 Bcast 172.16.1.255 Mask 255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU 1500 Metric 0 RX packets 3136 errors217 dropped 7 overrun 26 TX packets 1752 errors 25 dropped 0 overrun 0 5
  • 6. What is it saying? ● eth0 is the interface it is reporting on. It is the first of the ethernet interfaces on this computer. ● The Hardware Address is 00:0F:20:CF:8B:42. This is sometimes called the MAC address (Media Access Control), and is a hexadecimal number assigned to the ethernet card at the factory. ● The internet address is 172.16.1.2. This is the address assigned to this computer. 6
  • 7. What is it saying? 2 ● The Broadcast Address is 172.16.1.255. This is an address that can be used to send messages to every computer on the same subnet as this computer. ● The Subnet Mask is 255.255.255.0. This can be thought of as defining or identifying the subnet this computer is part of. ● The rest of it tells about packets sent, received, dropped, etc. 7
  • 8. Use for information ● The first thing most beginners will want to do is use this for information. ● If you find you are not connected to the Internet, use this command to see if your interface is configured and active. ● You can use this to check on your IP address and subnet mask. ● There is an equivalent for wireless interfaces, called iwconfig. 8
  • 9. Parallels for newbies ● Windows 95 through ME had a command called winipcfg ● Windows NT through Windows Vista have ipconfig ● These are essentially similar to the Unix command ifconfig 9
  • 10. Syntax ● ifconfig interface [address [parameters]] ● interface is the interface name, such as eth0 (first ethernet device) or lo (local host) ● address is the IP address assigned to the interface. This can be specified as a dotted quad address, or as a name that can be looked up in /etc/hosts. 10
  • 11. Parameters ● up – Makes an interface accessible to the IP layer. ● down – Makes an interface inaccessible to the IP layer, i.e. stops all traffic through this interface. ● netmask mask – Sets the subnet mask to be used by the interface. ● broadcast address – Sets the broadcast address. 11
  • 12. Warning! ● If you are not a network administrator, be very careful about setting addresses from the command line. Even people with some experience can get confused setting a subnet mask. You don't want your interface to stop working in some mysterious way. ● Using this command to get information is completely safe. 12
  • 13. Warning! 2 ● If you do want to experiment (a very good way to learn about these things), just make sure you are not using a mission-critical computer. Whatever you screw up you will need to unscrew.☺ 13
  • 14. More on this command ● There are other parameters and options available for this command, but they go beyond the requirements for this presentation. Consult Google or the man page for more information. ● A good readable guide to the basics can be found at http://tldp.org/LDP/nag2/x-087-2- iface.ifconfig.html 14
  • 15. Examples ● ifconfig eth0 – View the network settings on the first Ethernet adapter installed in the computer. ● ifconfig -a – Display information on all network interfaces on the computer, active or inactive. ● ifconfig eth0 down – Would take down the interface, and no packets would be sent or received. ● ifconfig eth0 up – Would bring the interface back up so it could send and receive data. 15
  • 16. Examples 2 ● ifconfig eth0 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255 – This would assign these values to the first Ethernet device installed in the computer. Be careful here! 16

×