# Static/DHCP IP



## kucharski27 (May 12, 2005)

I currently have a static ip address assigned in the rc.sysinit.author file, but everything I reboot the tivo device it trys to assign a DHCP ip address before the static ip address takes over. Are there any other files I need to modifiy so that DHCP doesn't try to grab an ip. Here is my rc.sysint.author. Any help would be appreciate it.

Thanks...

STATIC_IP=x.x.x.20
NETMASK=255.255.255.0 
BROADCAST=x.x.x.255
GATEWAY=x.x.x.1

if [ -f /init/ptv_flags/FIRSTTIME_ON ]; then
tivosh /ptvupgrade/bin/51killer.tcl
/ptvupgrade/bin/rootwrite;
cp /init/ptv_images/PromScreen2Version7.NTSC.png /tvbin
rm -rf /init/ptv_flags/FIRSTTIME_ON
/ptvupgrade/bin/rootread;
sync
reboot
fi
#######

# This sets the priority of hacks and shell commands to the lowest 
# possible priority so that the TiVo operation is not affected by
# your tinkering; uncomment this if you find your tinkering gets in the
# way, just note that sometimes you can lock up the shell if you do have this
# uncommented, so be prepared with a serial cable, just in case you mess things
# up.
# setpri fifo 1 $$

# Startup BASH in case you are using a serial cable to connect
# This has been moved to the /init directory so that shell starts
# right at boot time
# /bin/bash -login</dev/ttyS2&>/dev/ttyS2 &

# Lets set the path to look in our own bin first, and then busybox
export PATH=$PATH:/ptvupgrade/bin:/ptvupgrade/busybox

# An extra library directory needed for yac and elseed
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ptvupgrade/lib

# Check flags for IP address (we recommend you just stick with DHCP)
if [ -f /init/ptv_flags/DHCP_OFF ]; then
/ptvupgrade/bin/dhcp_enable.ptv
fi

if [ -f /init/ptv_flags/STATIC_ON ]; then
ifconfig eth0 $STATIC_IP broadcast $BROADCAST netmask $NETMASK
route add default gw $GATEWAY
fi

sleep 3

#start telnet

if [ -f /init/ptv_flags/TELNET_ON ]; then
tnlited 23 /bin/bash -login &
fi

#start ftp

if [ -f /init/ptv_flags/FTP_ON ]; then
/ptvupgrade/bin/tivoftpd
fi

#start tivowebplus

if [ -f /init/ptv_flags/TIVOWEB_ON ]; then
mkdir -p /var/hack
/ptvupgrade/TivoWebPlus/tivoweb
sleep 30
fi

# check to see if PHONE_OFF has been set - if it is then we check to ensure
# cron is setup so that fakecall is automatically run

if [ -f /init/ptv_flags/PHONE_OFF ]; then
if ! [ -f /var/spool/cron/crontabs/root ]; then
/ptvupgrade/misc/cron_stuff/setup_cron
fi 
phonereset.tcl
fakecall.tcl
crond
fi

# start extended tpm apps or other things
# thanks mike for the tpm structure

for i in /init/ptv_start/S[0-9][0-9]* 
do 
# Check if the script is there 
[ ! -f $i ] && continue 
source $i start 
done


----------



## Biggles209 (Dec 17, 2006)

Dummy post to get around 5 post restriction


----------



## Biggles209 (Dec 17, 2006)

Dummy


----------



## Biggles209 (Dec 17, 2006)

...


----------



## Biggles209 (Dec 17, 2006)

From my notes:

12)	Set static IP address stuff in rc.sysinit.author

bash-2.02# flag_swap NETWORK
STATIC set to OFF. Now setting it to ON and turning off DHCP
bash-2.02# cd /sbin
bash-2.02# rootwrite
making root filesystem writable; type 'rootread' to make read-only...

executing mount -o remount,rw /

done!
bash-2.02# mv dhclient dhclient.org
bash-2.02# touch dhclient
bash-2.02# chmod 755 dhclient
bash-2.02# sync
bash-2.02# restart

13)	Set hosts look-up

a)	cd /etc
b)	delete " dns" on hosts: line in nsswitch.conf
c)	set up hosts file
d)	check resolv.conf


----------



## MungoJerrie (Mar 30, 2006)

Or you could just:

```
touch /init/ptv_flags/STATIC_ON
```
Since this is the controlling code:

```
if [ -f /init/ptv_flags/STATIC_ON ]; then
ifconfig eth0 $STATIC_IP broadcast $BROADCAST netmask $NETMASK
route add default gw $GATEWAY
fi
```
Which basically checks for a file called "STATIC_ON" in /init/ptv_flags and if it exists (-f) the script manually sets a static ip address.


----------



## captain_video (Mar 1, 2002)

What kind of Tivo do you have? Static IP setup varies based on the type of Tivo and OS version you're using. I'm no Linux guru but I've been hacking Tivos a long time and I have no clue what you're doing with your Tivo. Have you actually done any research on setting up a static IP for a Tivo because it looks like you're just plain winging it? Hint: If you have a series 2 Tivo then do a search for netconfig.tcl or network.tcl.


----------



## mphare (Jul 16, 2004)

Why is a static IP preferred over a dynamic one?

I've set my router up to assign the same IP based on the MAC. So, even though the DTiVos all use DHCP, they always get the same IP when they are rebooted.


----------



## JWThiers (Apr 13, 2005)

By definition a Dynamic IP can change. If the IP ever changes, in order to do ANYTHING (Except MRV) on your hacked tivo you have to find the IP. 

Some routers do allow for a Dynamically assigned IP that does not change. My experience with this is that on the two different brands of routers (Linksys and Belkin) when the router loses power or is reset for any reason the DHCP client list also gets reset also, including the addresses that you wanted to be static. This means that the IP addresses start getting assigned again starting from the first address used in the range used by DHCP by your router on a first come first served basis. So unless all of your network enabled devices that use DHCP log into the network in exactly the same order every time they get a different IP.

Networks were designed to be run by network administrators and technically savy people. The reason that DHCP exists at all is that it was a way to get more devices onto a network than they could by every device having a static address. Not all devices are connected at the same time or for log periods of time. A side effect of DHCP is that it makes it easy to connect things to a network. This is being exploited so regular people can fairly easily run a simple home network. Unfortunately DirecTV does not support networking of its tivo's, and the way that they disabled it was that some of the networking control sections of the code was removed from the OS and that DirecTV does not give it units a Media Access Key (MAK) that would let Tivo Desktop access the Tivo. Most of the software that we use is a program that uses a generic interface to use (Web Browsers, FTP/Telnet Clients, etc.). and there they don't look for only a tivo to work with. In order to use them the user has to know things like what the IP is. Custom software on the other hand, looks for tivo's determines their IP and is specfically designed to work with a tivo and ONLY a tivo.


----------



## luder (Sep 7, 2006)

JWThiers said:


> By definition a Dynamic IP can change. If the IP ever changes, in order to do ANYTHING (Except MRV) on your hacked tivo you have to find the IP.
> 
> Some routers do allow for a Dynamically assigned IP that does not change. My experience with this is that on the two different brands of routers (Linksys and Belkin) when the router loses power or is reset for any reason the DHCP client list also gets reset also, including the addresses that you wanted to be static. This means that the IP addresses start getting assigned again starting from the first address used in the range used by DHCP by your router on a first come first served basis. So unless all of your network enabled devices that use DHCP log into the network in exactly the same order every time they get a different IP.
> 
> Networks were designed to be run by network administrators and technically savy people. The reason that DHCP exists at all is that it was a way to get more devices onto a network than they could by every device having a static address. Not all devices are connected at the same time or for log periods of time. A side effect of DHCP is that it makes it easy to connect things to a network. This is being exploited so regular people can fairly easily run a simple home network. Unfortunately DirecTV does not support networking of its tivo's, and the way that they disabled it was that some of the networking control sections of the code was removed from the OS and that DirecTV does not give it units a Media Access Key (MAK) that would let Tivo Desktop access the Tivo. Most of the software that we use is a program that uses a generic interface to use (Web Browsers, FTP/Telnet Clients, etc.). and there they don't look for only a tivo to work with. In order to use them the user has to know things like what the IP is. Custom software on the other hand, looks for tivo's determines their IP and is specfically designed to work with a tivo and ONLY a tivo.


+1
I'm a 2wire geek and for what i know so far 2wire has given me Static Dhcp and is a pretty good 2 for one system MRV is in the raw like JW mention on Dtivo they don't give MAK to any of there units there is told stories that JavaHMO could work with it but, i have no luck yet


----------

