Sponsored Content
Special Forums IP Networking How to get IP of computer assigned by DHCP? Post 302883530 by corrado33 on Wednesday 15th of January 2014 11:34:06 AM
Old 01-15-2014
I think if I "ssh 'hostname" that might work. I guess I could check through the vpn.

For those of you confused here is what's going on.

I have a Mac desktop that I use for my day to day work. Sometimes I want to ssh into it from my iPad over wifi to do some data analysis, so I have an ssh server running. Just the standard ssh server that ships with os X, nothing special. Only I have permission etc.

However, the intranet at work is DHCP based. I cannot request a static IP because it costs money (stupid I know.)

Sometimes I forget to grab my IP before I leave the office, so if I want to ssh into the computer I can't, because of DHCP. So my original question was what is the best way to get that IP if I am not currently in front of the computer.

I did not know you could use the hostname of a computer as the address essentially. As I stated before, I'm terrible at networking.

With that said, it iSSH on the ipad does not like using the hostname over a VPN (I'm testing it from home currently), but using the IP works perfectly.

Putty on XP says "host does not exist" when connected through the VPN even when I copy and paste the hostname from the result of the "hostname" command. Putting the IP into putty works just fine.

---------- Post updated 01-15-14 at 12:34 PM ---------- Previous update was 01-14-14 at 10:08 PM ----------

Sorry for the double post, I thinking I found some more hints about my problem.

My ip when I'm on the wireless network is aaa.bbb.100.### and the ip of the server is aaa.bbb.185.### where aaa and bbb are the same. So, in my limited knowledge of networking, I'd say that whenever I feed my ipad a hostname to try to connect to, it doesn't know where it is because it's on a slightly different network, but when I give it an ip, the ipad knows exactly where to look for the computer to find it.

I think I may be able to fix it by adding another DNS server in my network settings? But I don't know what to put. Or it has something to do with the hostname. The hostname I am using is something-computer.local. Can the .local be changed to tell the ipad to look somewhere else?

Last edited by corrado33; 01-14-2014 at 10:18 PM..
 

10 More Discussions You Might Find Interesting

1. AIX

Re: User assigned to privileged group

Hi! I need to know what is the risk involved if a user with UID >100 is attached to a group with gid =1 .i.e., a user is attached to a priviliged group in AIX . Kindly let me know what security implication can arise in this case? Early reply in this regard will be highly appreciated. (1 Reply)
Discussion started by: faraz82
1 Replies

2. UNIX for Dummies Questions & Answers

What does $? mean when assigned to a variable?

If i write this statement in a Korn Shell script RCODE=$? what possibly does it eman? (3 Replies)
Discussion started by: ranjita.c
3 Replies

3. Solaris

Unix terminal re-assigned with wrong IP address from window's DHCP

Hi all, I have this problem that puzzles me, i have setup all the right DHCP configuration in Windows Server. The reservation IP address in windows for this specific unix terminal. However, when i rebooted the unix terminal the IP which was already assigned for this box somehow change to a total... (0 Replies)
Discussion started by: tlee
0 Replies

4. Shell Programming and Scripting

how to remove the assigned value from the string

Hi I have the following assignment in my ksh script: PX_LIST="4119 2390 2294 2776 2897 4099" Is there any sed/awk command which would allow the to remove certain number from this string. Let's say I need to remove PX=2390 from PX_LIST, so the output after deletion will be" PX_LIST="4119 2294... (5 Replies)
Discussion started by: aoussenko
5 Replies

5. Shell Programming and Scripting

Check if a variable has a value assigned?

Hi, I want to check if a variable has a value assigned to it or not. I can do following - cat $Var > File1 if then echo "$Var has value" else echo "$Var is null" fi But I have to check for 3 Variables and I want to wrap it up in couple of unix statements. Any... (3 Replies)
Discussion started by: sumeet
3 Replies

6. Red Hat

Which IPs from the range are assigned to DHCP enabled clients

Hi All dhcpd.conf has a range of IPs sa for example( 192.168.1.201 192.168.1.220) So this is the range of IP addresses the server will issue to DHCP enabled PC clients booting up on the network How do i know which IPs are being used or which IPs from the range are assigned to dhcp enabled... (11 Replies)
Discussion started by: tannu
11 Replies

7. Shell Programming and Scripting

Curly braces assigned to variables

Hi, Im pretty new to Unix. I came across a script which was using PLSQL inside a script and there was an unusual thing mentioned. there was a variable assigned as P_CUR=${1} and one more as V_TAGFILE="$1" Couldnt find the difference. Also the variables were used in PLSQL... (1 Reply)
Discussion started by: njks68
1 Replies

8. Shell Programming and Scripting

[Bash] Variable won't get assigned value

I am making of a script that will go through a couple of for loops and create file names based on the values in that loop, however the variable that combines everything is not getting assigned properly: #! /bin/bash for imod in K33_j1b_WS9_6 do for emod in mb2A mb2C mb3A mb3C mb4A... (1 Reply)
Discussion started by: badinsults
1 Replies

9. UNIX for Dummies Questions & Answers

How do you check if a variable has been assigned?

I am trying to check whether a variable has been assigned on the command line or not. Here is what I did: #!/usr/bin/bash if( $variable == '\0') { print "variable was not assigned" exit } else NF = 2 {print $1, ""} exit fi awk -f question1.awk variable = 58 letters.txt. So... (3 Replies)
Discussion started by: Fred63528
3 Replies

10. IP Networking

Get DHCP relay interfaces IP address using DHCP

Hi All , please view the set up below: ------------------------------------------------------------------- | DHCP Server |-----------| ROUTER & |-----------| Clients | | 192.168.99.1 | - -<eth1>| DHCP-RELAY|<eth2>-- | 192.168.88.X | ... (2 Replies)
Discussion started by: gdangoor
2 Replies
SYSTEMSETUP(8)						    BSD System Manager's Manual 					    SYSTEMSETUP(8)

NAME
systemsetup -- configuration tool for certain machine settings in System Preferences. SYNOPSIS
systemsetup [-getdate] [-setdate mm:dd:yy] [-gettime] [-settime hh:mm:ss] [-gettimezone] [-listtimezones] [-settimezone timezone] [-getusingnetworktime] [-setusingnetworktime on | off] [-getnetworktimeserver] [-setnetworktimeserver timeserver] [-getsleep] [-setsleep minutes] [-getcomputersleep] [-setcomputersleep minutes] [-getdisplaysleep] [-setdisplaysleep minutes] [-getharddisksleep] [-setharddisksleep minutes] [-getwakeonmodem] [-setwakeonmodem on | off] [-getwakeonnetworkaccess] [-setwakeonnetworkaccess on | off] [-getrestartpowerfailure] [-setrestartpowerfailure on | off] [-getrestartfreeze] [-setrestartfreeze on | off] [-getallowpowerbuttontosleepcomputer] [-setallowpowerbuttontosleepcomputer on | off] [-getremotelogin] [-setremotelogin on | off] [-getremoteappleevents] [-setremoteappleevents on | off] [-getcomputername] [-setcomputername computername] [-getstartupdisk] [-liststartupdisks] [-setstartupdisk path] [-getwaitforstartupafterpowerfailure] [-setwaitforstartupafterpowerfailure value] [-getdisablekeyboardwhenenclosurelockisengaged] [-setdisablekeyboardwhenenclosurelockisengaged yes | no] [-getkernelbootarchitecturesetting] [-setkernelbootarchitecture i386 | x86_64 | default] [-version] [-help] [-printCommands] DESCRIPTION
The systemsetup command is used to configure certain per-machine settings typically configured in the System Preferences application. The systemsetup command requires at least "admin" privileges to run. A list of flags and their descriptions: -getdate Displays the current date. -setdate mm:dd:yy Use this command to set the current month, day, and year. -gettime Displays the current time in 24-hour format. -settime hh:mm:ss Sets the current time. The provided time argument should be in 24-hour format. -gettimezone Displays current time zone. -listtimezones Lists all time zones supported by this machine. -settimezone timezone Use this command to set the local time zone. Use "-listtimezones" to list valid timezone arguments. -getusingnetworktime Displays whether network time is on or off. -setusingnetworktime on | off Sets whether using network time is on or off. -getnetworktimeserver Displays the currently set network time server. -setnetworktimeserver timeserver Use this command to designate a network time server. Enter the IP address or DNS name for the network time server. -getsleep Displays amount of idle time until machine sleeps. -setsleep minutes Sets amount of idle time until computer sleeps. Specify "Never" or "Off" for computers that should never sleep. Important: if you set the system to sleep, you will not be able to administer the server remotely while it is sleeping. -getcomputersleep Display amount of idle time until computer sleeps. -setcomputersleep minutes Set amount of idle time until computer sleeps. Specify "Never" or "Off" for never. -getdisplaysleep Display amount of idle time until display sleeps. -setdisplaysleep minutes Set amount of idle time until display sleeps. Specify "Never" or "Off" for never. -getharddisksleep Display amount of idle time until hard disk sleeps. Specify "Never" or "Off" for never. -setharddisksleep minutes Set amount of idle time until hard disk sleeps. Specify "Never" or "Off" for never. -getwakeonmodem Displays whether wake on modem is on or off. -setwakeonmodem on | off Use this command to specify whether or not the server will wake from sleep when modem activity is detected. -getwakeonnetworkaccess Displays whether wake on network access is on or off. -setwakeonnetworkaccess on | off Use this command to specify whether the server wakes from sleep when a network admin packet is sent to it. -getrestartpowerfailure Displays whether restart on power failure is on or off. -setrestartpowerfailure on | off Use this command to specify whether the server automatically restarts after a power failure. -getrestartfreeze Displays whether restart on freeze is on or off. -setrestartfreeze on | off Use this command to specify whether the server restarts automatically after the system freezes. -getallowpowerbuttontosleepcomputer Enable or disable whether the power button can sleep the computer. -setallowpowerbuttontosleepcomputer on | off Enable or disable whether the power button can sleep the computer. -getremotelogin Displays whether remote login (SSH) is on or off. -setremotelogin [-f] on | off Sets remote login (SSH) to either on or off. Important If you turn off remote login, you won't be able to administer the server using remote command line tools and SSH. To turn remote login back on, you'll need to connect a monitor and keyboard to the server to administer it locally. Use "setremotelogin -f off" to suppress prompting when turning remote login off. -getremoteappleevents Displays whether remote apple events are on or off. -setremoteappleevents on | off Use this command to set whether the server responds to events sent by other computers (such as AppleScripts). -getcomputername Displays computer name. -setcomputername computername Sets computer name to <computername>. This name is used by AFP. -getlocalsubnetname Display local subnet name. -setlocalsubnetname name Set local subnet name to <name>. -getstartupdisk Displays current startup disk. -liststartupdisks Lists all valid startup disks on this computer. -setstartupdisk path Sets current startup disk to the indicated path. Valid arguments can be listed using "-liststartupdisks." -getwaitforstartupafterpowerfailure Get the number of seconds after which the computer will start up after a power failure. -setwaitforstartupafterpowerfailure seconds Set the number of seconds after which the computer will start up after a power failure. The <seconds> value must be a multiple of 30 seconds. -getdisablekeyboardwhenenclosurelockisengaged Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. -setdisablekeyboardwhenenclosurelockisengaged yes | no Set whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. -getkernelbootarchitecturesetting Gets the Kernel Architecture setting from the com.apple.Boot.plist. -setkernelbootarchitecture i386 | x86_64 | default Set the kernel to boot in 32 or 64 bit mode on next boot. default removes the setting. -version Displays version of systemsetup tool. -help Displays a list of all the commands available in the System Setup Tool, with explanatory information. -printCommands Displays a list of commands with no detail. EXAMPLES
systemsetup -setdate 04:15:02 systemsetup -settime 16:20:00 systemsetup -settimezone US/Pacific systemsetup -setnetworktimeserver time.apple.com FILES
/usr/sbin/systemsetup SEE ALSO
networksetup(8) Mac OS X April 15, 2002 Mac OS X
All times are GMT -4. The time now is 10:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy