We’ll make what Unix geeks call a “pipe” by separating the two commands with the “|” symbol, which causes the output of the first command to be fed to the second command as its input. The first command we’ll use is grep, a simple pattern matching filter. Rather than just scan this visually, however, let’s use some Unix commands to extract the data we want. The number you want to identify is immediately after the “inet” field. Supported media: none autoselect 10baseT/UTP. There are some utilities and apps you can use, and for that matter you can also go to “System Preferences…” off the Apple menu and look at your “Network” panel, but let’s stick with “ifconfig” because it’s a bit more interesting to use the command line… The easiest way to identify your IP address is to pop open the Terminal (go to Applications -> Utilities -> Terminal) and type in the interface configuration (ifconfig) command. Typically DHCP servers are configured to give 24 hour leases, so it’s not quite as much a moving target. Well, you actually get what’s called a “lease”, so you only get a new address when your lease expires. If you’re running Dynamic Host Configuration Protocol (DHCP) then you’re right, you’ll get a new IP address (possibly recycled) each time you connect to the Internet.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |