[crossposted to comp.os.linux.networking,alt.os.linux.slackware. Please
crosspost the first followup, but set your folloups-to to your own NG,
thanks]
I have DSL with a dynamic IP from Verizon, and want to put a web site up.
Right at the moment, I've got two basic Slack 10.0 boxen plugged into a
hub at the modem, and one of these computers, ops, is at 4.11.176.118,
and the other, daphne, is at 4.11.176.232. Apparently, Verizon's got a lot
of slack in this block, because the same IP has been getting renewed for
quite some time.
DSL ---- HUB ---+---- Daphne = 4.11.176.232
|
+---- Ops = 4.11.176.118
On daphne, I have ordinary IP masquerading, and it's also routing for
thunderbird from 192.168.0.1:
4.11.176.232 - Daphne - 192.168.0.1 - 192.168.0.199 - Thunderbird
And Ops has a 4-port "router" card at 10.0.0.1, serving a LAN:
4.11.176.118 - ops - 10.0.0.1 --+-- 10.0.0.199 entheos
+-- 10.0.0.198 abi-ofc1
+-- 10.0.0.197 boogeyman
and a few more
ops is in use by the company, so I don't want to break it, but I can do
anything I want to to daphne; it's my development box.
And everything is working properly, with a couple of exceptions, which
are the important bit, I'm pretty sure. When I sit at thunderbird I can
browse daphne at 192.168.0.1 _or_ 4.11.176.232. When I sit at entheos I
can browse ops at 10.0.0.1 _or_ 4.11.176.118.
Daphne has masquerading straight out of the HOWTO:
------------------
root@daphne:/etc/rc.d# cat /usr/local/sbin/masq-on
modprobe ipt_MASQUERADE # If this fails, try continuing anyway
iptables -F; iptables -t nat -F; iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptables -P INPUT DROP #only if the first two are succesful
iptables -A FORWARD -i eth0 -o eth0 -j REJECT
root@daphne:/etc/rc.d# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere state NEW
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@daphne:/etc/rc.d#
-----------------------------
when I do netstat -tap on daphne, I get:
-------------
root@daphne:/etc/rc.d# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:time *:* LISTEN 133/inetd
tcp 0 0 *:submission *:* LISTEN 156/sendmail: accep
tcp 0 0 *:sunrpc *:* LISTEN 127/rpc.portmap
tcp 0 0 *:http *:* LISTEN 168/httpd
tcp 0 0 *:auth *:* LISTEN 133/inetd
tcp 0 0 192.168.0.1:domain *:* LISTEN 140/named
tcp 0 0 wbar5-lax1-4-11-:domain *:* LISTEN 140/named
tcp 0 0 localhost:domain *:* LISTEN 140/named
tcp 0 0 *:ssh *:* LISTEN 136/sshd
tcp 0 0 *:smtp *:* LISTEN 156/sendmail: accep
tcp 0 0 localhost:953 *:* LISTEN 140/named
tcp 0 0 192.168.0.1:ssh 192.168.0.199:32778 ESTABLISHED 842/sshd: rich [pri
root@daphne:/etc/rc.d#
-----------------------------------------
Ops has the same masquerading scriptlet, plus rc.firewall:
#!/bin/bash
#
# rc.firewall Linux Firewall version 2.0rc9 -- 05/02/03
#
http://projectfiles.com/firewall/
#
# Copyright (C) 2001-2003 Scott Bartlett <(E-Mail Removed)>
#
<snip>
PERMIT="10.0.0.0/16"
# List internal (private) interfaces here to allow this machine to act as a
# router. All interfaces NOT listed here are considered external (public)
# and will be automatically protected by the firewall.
# Example: INTERNAL_INTERFACES="eth1 eth2 brg0"
INTERNAL_INTERFACES="eth1"
# List dial-up and other interfaces without a static IP address here.
# Interfaces configured to obtain an IP address automatically (DHCP) do not
# need to be listed here unless for some reason your DHCP client does not
# receive the same address each time it renews the lease.
# Example: DYNAMIC_INTERFACES="ppp0"
DYNAMIC_INTERFACES=""
# Most users do not need to change anything below this point.
########################################
# -- Advanced Configuration Options -- #
########################################
# ** DO NOT ** modify anything below unless you know what you are doing!!
# See online documentation at:
http://projectfiles.com/firewall/config.html
DENY_OUTBOUND=""
ALLOW_INBOUND=""
BLACKLIST="129.250.134.115"
STATIC_INSIDE_OUTSIDE=""
--------- snip to end
Other than the "PERMIT" line, internal interfaces, and that one BLACKLIST
entry, it's exactly as downloaded. I don't want to post it, because it's
73K.
I've added a line to daphne:/etc/inetd.conf, which I got while STFW
yesterday (I've been reading all day and all night, and still can't find
an answer on my own):
----
# web server
http stream tcp nowait root /usr/sbin/tcpd
----
The rest of it is right out of the box.
But when I'm sitting at entheos, and try to surf daphne at 4.11.176.232, I
get:
An error occurred while loading
http://4.11.176.232/:
Timeout on server
Connection was to 4.11.176.232 at port 80
-----
Which seems to tell me I'm missing something. I haven't changed inetd.conf
on ops at all, because I'm afraid to break it, because it's in daily use,
which is why I wanted to get this going on daphne first.
So, either there's some other thing I need to do to open that port, or
Verizon is blocking port 80 for dynamic IPs. I talked to the guy at
Verizon, and asked him, If I go ahead and configure a bind server here,
and tell register.com to use it for the nameserver, am I allowed to do
that? Apparently, it's the first time anybody's ever asked such a thing,
so they don't have a rule against it.
I'm trying to save the $20.00 a month more that a static IP costs.
But I want to make sure I'm not missing something before I call them and
ask if they've got port 80 blocked, if they haven't.
Something else I've noticed in my plowing through docs is that people have
mentioned opening the port using iptables, and I don't know how to do that.
And interestingly, all of the posts & websites I've found seem to be
focused on _closing_ port 80.
So is there a line I can put in iptables - I don't even know the
terminology - give it another chain? That will let external requests
reach Apache?
Or, whatever else I haven't yet gotten to in my reading.
Once I do that (if it's actually possible) then I'll see about letting
http requests through rc.firewall.
Just for completeness, rc.firewall on ops does this:
--------------
root@ops:/etc# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
DROP all -- anywhere web.tickle.com
DROP all -- web.tickle.com anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- 10.0.0.0/8 anywhere state NEW
ACCEPT udp -- anywhere anywhere state NEW udp dpt:bootps
ACCEPT all -- anywhere anywhere state NEW
TRUSTED all -- anywhere anywhere state NEW
Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- anywhere web.tickle.com
DROP all -- web.tickle.com anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- 10.0.0.0/8 anywhere state NEW
TRUSTED all -- anywhere anywhere state NEW
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP all -- anywhere web.tickle.com
DROP all -- web.tickle.com anywhere
ACCEPT icmp -- anywhere 10.0.0.0/8
DROP icmp -- anywhere anywhere state INVALID
Chain TRUSTED (2 references)
target prot opt source destination
ACCEPT all -- 10.0.0.0/16 anywhere
ACCEPT icmp -- anywhere wbar5-lax1-4-11-176-118.dsl-verizon.net icmp echo-request
ACCEPT icmp -- anywhere ops.dsl-verizon.net icmp echo-request
DROP icmp -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
root@ops:/etc#
------------------
I hope this makes sense.
Bottom line, what do I need to do here to either open port 80 or confirm
that I've got it open but Verizon blocks it?
Thanks,
Rich