#65625 - 01/02/2002 15:55
Easiest way to switch from/to DHCP?
|
carpal tunnel
Registered: 23/08/2000
Posts: 3826
Loc: SLC, UT, USA
|
Okay, the scenario:
I use my empeg at home and at work. At home, it has a static assigned internal IP. At work, it has to use DHCP.
Problem:
I have to hook up a USB or serial cable every time i wanna switch it from one to the other, since if i'm at work, and the last place i used it was at home, i can't access it via ethernet because it's still on it's at home assigned IP and the oppisite for work. Got it?
I KNOW i could just change it before i leave home to DHCP or visa versa, and I KNOW i could just use USB at home or at work. The former will never happen as i'm running out the door in the morning, and the later won't work because i want it to be network accessible in both places.
SO, is there some way to switch from Assigned IP to DHCP on the player, on the fly? I'm fairly certain there isn't, and i know this has come up before. Could this be written into HiJack?! That would rock. Any other ideas that i'm too stupid to see?
Thanks.
|
Top
|
|
|
|
#65626 - 01/02/2002 16:23
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
I used to be in this situation, and my workaround was to add another fixed IP address to the box as described in the FAQ here.
What OS are you on at work?
|
Top
|
|
|
|
#65627 - 01/02/2002 16:29
Re: Easiest way to switch from/to DHCP?
[Re: tfabris]
|
carpal tunnel
Registered: 23/08/2000
Posts: 3826
Loc: SLC, UT, USA
|
Win2k... which is why i posted the question... should have mentioned i read that in the FAQ... no workie. =] I'd want others at work to have access to it without having to add another protocol to their machines. I'm on Win2k at home too.
This seems like a good candidate for a Hijack menu... Mark??? (does he read this forum?)
|
Top
|
|
|
|
#65628 - 01/02/2002 16:34
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
How I got it working under Win2K:
Someone sent me a link to a command-line utility to add a fixed IP address to the network properties. The only problem is that it's a command-line utility that needs to stay running while you're connected to the player. So you need to have a minimized DOS window as long as this IP has been added.
However, if you make an icon to launch it whenever you need it, or you put it in your startup group, or perhaps even turn it into a service with SRVANY or FireDaemon, then it could be almost transparent.
If you want it, I've got it...
|
Top
|
|
|
|
#65629 - 01/02/2002 16:37
Re: Easiest way to switch from/to DHCP?
[Re: tfabris]
|
carpal tunnel
Registered: 23/08/2000
Posts: 3826
Loc: SLC, UT, USA
|
Hrm... sounds cool.. but the place i want it to be available to everyone on the network is here at work... and i don't want to have to have everyone run that utility just to get to the player. Send it my way though... I can at least use it on my own machine. Thanks!
|
Top
|
|
|
|
#65630 - 01/02/2002 16:38
Re: Easiest way to switch from/to DHCP?
[Re: tfabris]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
Heh, I just looked at the doohickey I used to make the connection happen. It's rather tricky, and it requires a bit of customization. It's not plug-and-play. In fact, it's a rather rube-goldberg solution, which is why I didn't put it in the FAQ.
But it did work. If you want it, contact me personally and I'll work with you on getting it set up.
|
Top
|
|
|
|
#65631 - 01/02/2002 16:40
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
There's bound to be a freeware DHCP server for Windows out there somewhere. Get it and have it serve that same static IP address to the empeg every time you hook it up.
Edit: Perhaps this one?
Edited by wfaulk (01/02/2002 17:25)
_________________________
Bitt Faulk
|
Top
|
|
|
|
#65632 - 01/02/2002 16:45
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
Quick question, to anyone reading this thread.
Is there an easy way to have the Windows NT command prompt spit back JUST the computer's current IP address?
For instance, I know I can use a variable called %windir% to insert the Windows directory into a batch file without having to do any processing on the output. Is there a corresponding system variable for the IP address?
I know I can use IPCONFIG and it'll spit out a formatted table of a bunch of information, but I would have to parse through that table of data in order to retrieve just the IP address for use in a batch file.
In fact, that's what my rube-goldberg solution did, it dug the computer's current IP address out of a spit-out text file and used a third-party program to do the parsing work. Then I was able to feed the computer's current IP to the IPADD.EXE program (it was one of the program's necessary parameters).
The reason I don't want to just give that straight to Loren is that the "digger" program I used is licensed and I can't give it away.
|
Top
|
|
|
|
#65633 - 01/02/2002 17:49
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
pooh-bah
Registered: 13/09/1999
Posts: 2401
Loc: Croatia
|
Hm, a very inelegant solution: have two versions of config.ini (differing in networking details), development SW, 'Quit' option on player, and a piece of script in /etc/profile that will ask (using picker or something equivalent) which version to copy over the current file.
_________________________
Dragi "Bonzi" Raos
Q#5196
MkII #080000376, 18GB green
MkIIa #040103247, 60GB blue
|
Top
|
|
|
|
#65634 - 01/02/2002 17:52
Re: Easiest way to switch from/to DHCP?
[Re: bonzi]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
Interesting. If your only reason for using the Quit menu is to toggle DHCP on and off, that's not inelegant, that's actually quite elegant.
The only ugly part is that you'd have to replace the script each time you upgraded the player.
|
Top
|
|
|
|
#65635 - 01/02/2002 20:35
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
|
You saved me the trouble of posting a similar thread tonight. Actually, I had gotten about half way writing my initial post in the pogramming section when I decided to just put it off for another day.
I'd like an easy toggle or something semi-automated as well. I have a possible advantage, in that I'd like a fixed IP at home, but don't need it to be a specific number (not with my current setup anyway).
For me, a simple solution would be a small app that would find out what the empeg's assigned IP is, and toss it into my HOSTS file along with an alias.
That would give me a "constant" to reference the machine at home.
Anyone want to make that small app? The only negative is that the app would still need to be manually launched - unless it was active on the system all the time (not something I consider ideal). And this avoids having to set up a DHCP server on this machine. (But I'll look at the one linked to see what kind of impact it may have)
Bruno
|
Top
|
|
|
|
#65636 - 01/02/2002 20:53
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
pooh-bah
Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
|
Can't you just assign a second IP to the empeg? Let it get the first one via DHCP and then do something like...
ifconfig eth0 add 192.168.102.3 192.168.102.254 up
from init or another script? I haven't actually tried this on an empeg, but that would give you two IPs on a normal linux box IIRC. That gives you an eth0 and an eth0:1 so you are technically on both networks at the same time.
-Mike
|
Top
|
|
|
|
#65637 - 01/02/2002 22:04
Re: Easiest way to switch from/to DHCP?
[Re: wfaulk]
|
carpal tunnel
Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
|
That DHCP server you linked to is actually shareware and is 19 Euro plus any charges you might have to add for the developer to negotiate your payment. He really should do a better job of writing up the order text if he wants to collect any money.
Anyway, I'm sleepy and I can't get it to do anything right now. A small error pops up saying port 67 is in use already and that's about it (I'm running 2K). I haven't tried simply ignoring it and entering the empeg's mac into a static assignment yet though. (I'm too sleepy to memorize the mac as it scrolls in the about menu and also too sleepy to think about how to find out what it is using a different method.
Anyway, at some time tomorrow I can provide/accept further details if anyone wants to help out. Getting this to work should do the trick. Looks like this server software also has the ability to run as a service and looks like it may have a small footprint.
Bruno
|
Top
|
|
|
|
#65638 - 01/02/2002 22:18
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14491
Loc: Canada
|
If your at-Work DHCP server is reasonably responsive, then you could cobble up a moderately dumb shell script to do what you want, basically to hang around for say 30 seconds waiting for DHCP to configure eth0, and then to add a static IP if DHCP doesn't do the job by then. This script would run on the empeg.
Of course this is complicated somewhat, in that the tools needed to do the job are not present, not even on a developer image..
Perhaps I'll be forced into fixing it with Hijack the next time I have the unit someplace that lacks DHCP.. This could be a useful feature I suppose, even for me..
-ml
|
Top
|
|
|
|
#65639 - 01/02/2002 22:21
Re: Easiest way to switch from/to DHCP?
[Re: mcomb]
|
carpal tunnel
Registered: 23/08/2000
Posts: 3826
Loc: SLC, UT, USA
|
No ifconfig on the empeg. Good idea though.
|
Top
|
|
|
|
#65641 - 02/02/2002 07:12
Re: Easiest way to switch from/to DHCP?
[Re: loren]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14491
Loc: Canada
|
How about this for an idea (Hijack):
In config.ini, we add a couple of special "comment" statements, to allow hijack to modify config.ini as it is read by the player. This would use two keywords, @HOME and @WORK, that Hijack will choose between based on a menu selection. Best shown by example:
[Network]
Gateway=10.0.0.1
Netmask=255.0.0.0
IPAddress=10.0.0.26
;@HOME DHCP=0
;@WORK DHCP=1
DHCP=0
The keywords can be used anywhere in config.ini, and Hijack will simply choose one line or the other at run time, and feed that to the player (and to emplode), while preserving the original "commented" keyword lines.
So in the above file, the "DHCP=0" line does not actually exist.. it was inserted by Hijack when the file was read, and will be deleted when the file is written again.
This also would give us the capability of having Hijack "hijack" other config.ini settings in the future, and to do things like automatically enabling "notify=1" to obtain player status on ALL empegs (with "supress_notify=1" as the default in such cases).
Anyway, don't try it yet.. it does not exist. Just probing for input. Whatever we do has to be simple, to keep the code size down (CPU overhead doesn't really matter here, but code size DOES matter).
Cheers
|
Top
|
|
|
|
#65642 - 02/02/2002 07:54
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
enthusiast
Registered: 24/08/2001
Posts: 344
Loc: France, Champagne
|
Great Idea !!!!
Enjoy the Candle Light ...
_________________________
Empeg IIa - 10 Gb - Red Fascia -
Tuner, the day is coming
- I Will Strike From the Grey -
|
Top
|
|
|
|
#65643 - 02/02/2002 08:13
Re: Easiest way to switch from/to DHCP?
[Re: Nosferatu]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14491
Loc: Canada
|
>Enjoy the Candle Light ...
Yes, we will.. that oughta be fuel enough for a few more revisions of Hijack! Thanks!
-ml
|
Top
|
|
|
|
#65644 - 02/02/2002 08:32
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
Mark, that's fantastic. Brilliant.
From the looks of it, you could extend this "home/work" behavior farther than just those lines in the config.ini. Not sure what else you could use it for yet, but I'm sure someone else could think of something.
|
Top
|
|
|
|
#65645 - 02/02/2002 08:35
Re: Easiest way to switch from/to DHCP?
[Re: hybrid8]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
|
For me, a simple solution would be a small app that would find out what the empeg's assigned IP is, and toss it into my HOSTS file along with an alias.
Now, THIS I like. Great idea.
I would like to see this implemented, totally independent of Mark's immediate solution to Loren's problem. I'm going to start a separate thread under Programming just for this topic.
|
Top
|
|
|
|
#65646 - 02/02/2002 08:57
Re: Easiest way to switch from/to DHCP?
[Re: hybrid8]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Aargh. That's the only free-looking one I could find. I tell you what -- amateur Windows developers are some money-grubbing little bastards.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#65647 - 02/02/2002 10:42
Re: Easiest way to switch from/to DHCP?
[Re: tfabris]
|
carpal tunnel
Registered: 29/08/2000
Posts: 14491
Loc: Canada
|
Well, I'm sure folks would also want to use this with Hijack options like this:
[hijack]
;@WORK kftpd_control_port=0 ;; disable ftp access at work
;@WORK khttpd_port=0 ;; disable http access at work
Or even these "future" options:
;@WORK khttpd_files=0 ;; no file access except for streaming
;@WORK khttpd_dirs=0 ;; disable directory indexing
;@WORK khttpd_playlists=0 ;; disable playlist/m3u accesses
;@WORK site_rw=0 ;; disallow SITE/http RW command
;@WORK site_commands=0 ;; disallow all SITE/http commands
;@WORK kftpd_password=n0H4ck3Rz ;; require a password for ftp access
-ml
|
Top
|
|
|
|
#65648 - 02/02/2002 10:45
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
carpal tunnel
Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
|
Make it so.
Bruno
|
Top
|
|
|
|
#65649 - 02/02/2002 11:57
Re: Easiest way to switch from/to DHCP?
[Re: hybrid8]
|
pooh-bah
Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
|
Seconded!
Fabulous idea
_________________________
/Michael
|
Top
|
|
|
|
#65650 - 02/02/2002 12:40
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
carpal tunnel
Registered: 23/08/2000
Posts: 3826
Loc: SLC, UT, USA
|
|
Top
|
|
|
|
#65651 - 02/02/2002 13:12
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
carpal tunnel
Registered: 15/08/2000
Posts: 4859
Loc: New Jersey, USA
|
Greetings!
THANK YOU! How did you know I wanted password protection on the "site" commands???
_________________________
Paul Grzelak 200GB with 48MB RAM, Illuminated Buttons and Digital Outputs
|
Top
|
|
|
|
#65652 - 02/02/2002 14:39
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
addict
Registered: 10/11/2000
Posts: 497
Loc: Utah, USA
|
Why limit these types of things to just locations? How about having keywords that modify config.ini based on AC or DC power as well? (unless that's already implemented some other way in Hijack that I haven't seen)
-Aaron
_________________________
-Aaron
|
Top
|
|
|
|
#65653 - 02/02/2002 18:13
Re: Easiest way to switch from/to DHCP?
[Re: mlord]
|
old hand
Registered: 12/01/2000
Posts: 1079
Loc: Dallas, TX
|
Does kftpd already require a password? I would really appreciate it if there was some way to do that. I'm paranoid about running a ftp service on my empeg. :-)
Sean
|
Top
|
|
|
|
#65654 - 02/02/2002 18:19
Re: Easiest way to switch from/to DHCP?
[Re: Terminator]
|
carpal tunnel
Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
|
You'll need version 168 of hijack. Keep checking the programming section for the latest news.
Bruno
|
Top
|
|
|
|
|
|