LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2005, 01:14 AM   #1
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
Time Based Nat


Hello all
I have a colony ISP. that shares the 512 kbps wireless broad band internet connection to it's
colony members. i am using redhat9 and have configured transparent squid. and natting too.

the following is my nat configuration...
/sbin/iptables -t nat -F
/sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
/sbin/iptables -t nat -A POSTROUTING -s 139.61.0.0/16 -o eth0 -j MASQUERADE

#My squid configuration.

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

#http_access allow our_networks
acl our_networks src 139.61.0.0/16
http_access allow our_networks

# And finally deny all other access to this proxy
http_access allow localhost
http_access deny all

Now what i want is to select some ip for day surfing some for night surfing some unlimited surfing. i know that it can be performed by writing a script and execute it by using cron but what is the script?? can any one help me on this topic.
 
Old 07-03-2005, 01:21 AM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
My thought is,

Create 3 scripts, each with a different IP address. Name them: ip.night, ip.day, ip.unlimited
Edit your crontab and execute them at certain times.


You should then be able to just copy your current configuration to the 3 files and change the IP address.
----------------------------------
2nd idea

In the crontab. execute the command ifconfig eth0 10.0.0.4 255.0.0.0 replacing the IP and subnet with the IPs you wish to use.


<EDIT>
Read the Rules please. Do not double post.

Last edited by musicman_ace; 07-03-2005 at 06:20 AM.
 
Old 07-03-2005, 09:59 AM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Moved to Networking Forum.. for better exposure.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux based gateway for time-based wireless service. TotalDefiance Linux - Software 0 10-03-2005 07:06 PM
Time Based Nat roopunix Linux - Networking 1 07-03-2005 08:32 AM
NAT doesnt work for me this time.. stradivarius Linux - Networking 0 04-17-2004 01:00 PM
NAT doesnt work for me this time.. stradivarius Linux - Networking 0 04-17-2004 12:50 PM
Time based applicatioon qmon2002 Programming 7 02-05-2003 12:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration