Autoexec functionality in the RT 2.2 firmware
- studioeng
- Experienced
- Posts: 454
- Joined: Mon Oct 23, 2006 11:59 pm
- Location: Dorset, England
- Contact:
@biro - Are you saying that if you just leave it alone, it shall just 'work' ?? I can well beleive that would be the case, cron refreshing/updating itself after so long.
I upgraded to 2.3 last night, not really played with it much, didn't have time. At the moment, I can't get into my server from work, but I would assume that's either poor config on my behalf or my I'nets dropped again oO( D*mn ENTANET )
I may have imagined it, but I added the command to run uploaduptime.sh at the end of the install.sh script, just before it removed itself. I think from then on the file was updated every 15 minutes. I shall have to double check when I get chance.
I upgraded to 2.3 last night, not really played with it much, didn't have time. At the moment, I can't get into my server from work, but I would assume that's either poor config on my behalf or my I'nets dropped again oO( D*mn ENTANET )
I may have imagined it, but I added the command to run uploaduptime.sh at the end of the install.sh script, just before it removed itself. I think from then on the file was updated every 15 minutes. I shall have to double check when I get chance.
Truncated commands....
I'm running on a Solwise SAR600EW which seems to have this 64 character limit. This isn't enough to let me download and run the script. Any ideas on how to get around this? I'm running on 2.3.mstombs wrote:doh...
The full commands are in the environment are they? Check with getenv.
Some bootloaders have a limit of 64 chars.
Cheers,
Joel
- thechief
- RouterTech Team
- Posts: 12067
- Joined: Wed Feb 01, 2006 10:22 pm
- Location: England, the Centre of Africa
- Contact:
You can use the new "RT_cmd_x" commands to split up the commands - e.g., one to download the script, and another to run it - e.g.
Code: Select all
setenv RT_cmd_1 "cd /var && w get http://foo.com/foo.sh"
setenv RT_cmd_2 "chmod +x /var/foo.sh && /var/foo.sh"
The Chief: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
No support via PM. Ask all questions on the open forum.
- studioeng
- Experienced
- Posts: 454
- Joined: Mon Oct 23, 2006 11:59 pm
- Location: Dorset, England
- Contact:
Just another idea for you to try out; further to what thechief has suggested, I have got a file called 'script.sh' on my webserver which is called via the autoexec.sh function. From here I can add as many scripts as I like, and do not need to edit the setenv of the router each time that I need to add another script or edit it.
Hope that is helpful
Hope that is helpful
- studioeng
- Experienced
- Posts: 454
- Joined: Mon Oct 23, 2006 11:59 pm
- Location: Dorset, England
- Contact:
Moving on from the masquerade rule for the wireless interface, is it possible to have a masquerade rule which only respects a single public static IP address, and allows all other static IPs to act as normal?
The best way I can explain my question is; having multiple computers running through one public static IP, but without having another router between the modem and computers; while still having the other public static IPs working as normal; thus eliminating the routing between two different IP ranges and also removing another box.
Here is a very crude diagram; I hope that makes sence.
The best way I can explain my question is; having multiple computers running through one public static IP, but without having another router between the modem and computers; while still having the other public static IPs working as normal; thus eliminating the routing between two different IP ranges and also removing another box.
Here is a very crude diagram; I hope that makes sence.
Code: Select all
Before:
[modem] --- [router] --- [computers]
| \
| [wireless] --- [laptops]
|
[server*] --- [switch] --- [computers]
After:
[modem] --- [switch] --- [computers]
| \
| [wireless] --- [laptops]
|
[server*] --- [switch] --- [computers]
(*= server also acting as a router)
Not sure I', still up to speed with your growing network SE!. From what I recall
The modem is the Routertech firmware router running No-Nat, and this device has one of your usable range of 6 static IP addresses? The Masquerade rule turns on NAT for just your wireless PC address range.
The router is new to me, but if it is just a way to enable a number of devices to share another one of your static IPs I reckon a SNAT command as suggested by legume in the other thread could be used
viewtopic.php?p=20422&highlight=masquerade+snat#20422
I think you need to be careful though, running no-nat simplifies the job the router has to do, now you are thinking of running 2 types of NAT on the little device will that give bring the router nat tables/firewall/optimization problems back in?
The modem is the Routertech firmware router running No-Nat, and this device has one of your usable range of 6 static IP addresses? The Masquerade rule turns on NAT for just your wireless PC address range.
The router is new to me, but if it is just a way to enable a number of devices to share another one of your static IPs I reckon a SNAT command as suggested by legume in the other thread could be used
viewtopic.php?p=20422&highlight=masquerade+snat#20422
I think you need to be careful though, running no-nat simplifies the job the router has to do, now you are thinking of running 2 types of NAT on the little device will that give bring the router nat tables/firewall/optimization problems back in?
- studioeng
- Experienced
- Posts: 454
- Joined: Mon Oct 23, 2006 11:59 pm
- Location: Dorset, England
- Contact:
Thats correctmstombs wrote:Not sure I', still up to speed with your growing network SE!. From what I recall
The modem is the Routertech firmware router running No-Nat, and this device has one of your usable range of 6 static IP addresses? The Masquerade rule turns on NAT for just your wireless PC address range.
I wouldn't say it was a growing network, just keep thinking of weird and wonderful things that can be done with my network
I checked the link; didn't realise at first it was my 'Changing my ISP' thread Would that enable me to isolate the static IP, apply a kind of 'psudo' NAT to it, and not affect any other public IP on the network!?mstombs wrote:The router is new to me, but if it is just a way to enable a number of devices to share another one of your static IPs I reckon a SNAT command as suggested by legume in the other thread could be used
viewtopic.php?p=20422&highlight=masquerade+snat#20422
Am I right in thinking; iptables -t nat -A POSTROUTING -o ppp0 --src 192.168.1.0/24 -j SNAT --to-source 1.2.3.4 <- the public IP I wish this to run on??
The other problem I can think of now, is the DHCP of this NAT 'feature'; I asume I would need to run a DHCP somewhere on that 'sub-network' to issue the addresses etc!?
Well, you know me, I like the obscure, and pushing things further than they should go. If it breaks... 'oops, won't do that again!' and start from scratchmstombs wrote:I think you need to be careful though, running no-nat simplifies the job the router has to do, now you are thinking of running 2 types of NAT on the little device will that give bring the router nat tables/firewall/optimization problems back in?
I'm guessing that would all depend on the number of machines which are using the 'features' we are discussing? For example; with the wireless side I am currently only using 2-3 devices maximum at any one time. Seeing as I only have 1 wireless laptop, a PS3 and a Wii (which aren't used at the same time), so I wouldn't think that was under too much stress, unless it would use resources regardless of how many devices are using it!?
I think you'll just have to experiment, storing your scripts off the modem does mean you just reboot to return to known defaults. It is possible that the modem iptables doesn't have the required "to source" command. I don't know if you can use the web screen to configure the modem dhcp to do what you want - give out local IP addresses when it itself has an ISP address, but the half-bridge script does the opposite = gives out an ISP address when the modem has a local IP address so I'm sure it can be done!
You're welcome!
Personally I don't like to use the checksync function as you loose the log and don't know what caused the problem, and my connection used to be very fragile and frequently triggering. But I do know that its a useful feature if you are away and you know that it can fix all manner of problems!
Personally I don't like to use the checksync function as you loose the log and don't know what caused the problem, and my connection used to be very fragile and frequently triggering. But I do know that its a useful feature if you are away and you know that it can fix all manner of problems!