Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Force First HTML Page
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 945
Location: USA

PostPosted: Fri Oct 17, 2003 10:14 pm    Post subject: Force First HTML Page Reply with quote

I need two things

  • Everytime somebody gets an IP address and wants to go online I wana force him to go to a Special StartHomePage
  • If my connection to the INET is down I want that my Router checks if the Line is down or not. If the line is down I want my Router to force all the users to go to a local Page.

I have a couple of ideas but maybe somebody did that before and can give me some tips
_________________
cya
    ©®0t
Back to top
View user's profile Send private message
hbmartin
Guru
Guru


Joined: 12 Sep 2003
Posts: 386
Location: Home is where the boxen are

PostPosted: Sat Oct 18, 2003 3:00 am    Post subject: Reply with quote

You really need to post more details on what hardware you're using and your current setup.
You could probably set something up to catch all port 80 requests and reroute them (to some local Apache server) if INET is down.
Not sure about getting an intial page though, that would be harder.

Harold
Back to top
View user's profile Send private message
Cr0t
l33t
l33t


Joined: 27 Apr 2002
Posts: 945
Location: USA

PostPosted: Tue Oct 21, 2003 1:59 am    Post subject: Reply with quote

My Router

  • 233MHz Intel Penium MMX
  • 96MB SDRAM
  • 3.9 GB RAID 1
  • 232MB SWAP
  • 2x 3com 3c905

My IPTables Routing script...
Code:

modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
modprobe ip_nat_ftp
modprobe ip_nat_irc

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/tcp_ecn

iptables -t nat -F -v
iptables -F -v

iptables -A INPUT -i lo -j ACCEPT -v

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE -v

iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu -v
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -v

iptables -A INPUT -p tcp --dport 21 -j ACCEPT -v
iptables -A INPUT -p tcp --dport 22 -j ACCEPT -v
iptables -A INPUT -p tcp --dport 80 -j ACCEPT -v
iptables -A INPUT -p tcp --dport 161 -j ACCEPT -v
iptables -A INPUT -p tcp --dport 9999 -j ACCEPT -v

iptables -A INPUT -p tcp --dport 25 -j ACCEPT -v
iptables -A FORWARD -p tcp --dport 25 -j ACCEPT -v
iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT -v

iptables -A INPUT -p udp -i eth1 -s 192.168.1.0/24 --dport 67 -j ACCEPT -v
iptables -A INPUT -p tcp -i eth1 -s 192.168.1.0/24 --dport 67 -j ACCEPT -v

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 8080 -j DNAT --to-destination 192.168.1.2:80
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 8181 -j DNAT --to-destination 192.168.1.3:80
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 2121 -j DNAT --to-destination 192.168.1.2:21
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 2222 -j DNAT --to-destination 192.168.1.2:22
iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 2323 -j DNAT --to-destination 192.168.1.3:22

iptables -A INPUT -p tcp --syn -j DROP -v
iptables -P INPUT DROP -v

iptables -A INPUT -p udp --dport 135 -j REJECT -v
iptables -A INPUT -p udp --dport 137 -j REJECT -v
iptables -A INPUT -p udp --dport 138 -j REJECT -v
iptables -A INPUT -p tcp --syn --dport 139 -j REJECT -v
iptables -A INPUT -p tcp --dport 445 -j REJECT -v
iptables -A INPUT -p udp --dport 445 -j REJECT -v

iptables -A FORWARD -p udp --dport 135 -j REJECT -v
iptables -A FORWARD -p udp --dport 137 -j REJECT -v
iptables -A FORWARD -p udp --dport 138 -j REJECT -v
iptables -A FORWARD -p tcp --syn --dport 139 -j REJECT -v
iptables -A FORWARD -p tcp --dport 445 -j REJECT -v
iptables -A FORWARD -p udp --dport 445 -j REJECT -v

iptables -A OUTPUT -p udp --dport 135 -j REJECT -v
iptables -A OUTPUT -p udp --dport 137 -j REJECT -v
iptables -A OUTPUT -p udp --dport 138 -j REJECT -v
iptables -A OUTPUT -p tcp --syn --dport 139 -j REJECT -v
iptables -A OUTPUT -p tcp --dport 445 -j REJECT -v
iptables -A OUTPUT -p udp --dport 445 -j REJECT -v

iptables -A INPUT -i eth0 -j LOG
iptables -A INPUT -i eth1 -j LOG

I am guessing what I could do pining every once in a while to see if my connection is up. The problem is I do not know how to force each client to go to a special HomePage.
Well I have kinda one idea. I could start using a proxy which tells each client where to go. But as soon as my Router finds out that the target is out I should have a separate config file which tells the client where to go. And theeeeeeeeen they should see what's up.
Just an idea I am still developing ideas...
_________________
cya
    ©®0t
Back to top
View user's profile Send private message
ClausH
n00b
n00b


Joined: 03 Aug 2003
Posts: 58
Location: Herning, denmark

PostPosted: Wed Oct 22, 2003 7:40 pm    Post subject: Reply with quote

I would like to know something about this as well.
Today we lost the internet connection to our campus router, and we got a lot of phone calls concerning this. So it would be nice to put up a local page, and reroute all traffic to this (preferably to the local machine doing the routing) it would save us a lut of time.
The router is masquerading using iptables, and bandwith limiting using cbq.

Mvh Claus Holmgaard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum