This is one of those "do it this way" responses. If you want the theory
I'd be glad to give it to you but I'm assuming you just want this to
work.

First, the NAT (network address translation). Install the wonderful
package ferm. Here's the file I use to do masquerading and nothing else:

# just for natting
option iptables
option clearall
option createchains
table filter {
    chain FORWARD policy ACCEPT {
        daddr 192.168.0.0/16 ACCEPT;
    }
}
table nat chain POSTROUTING {
    outerface eth0 saddr (
        192.168.0.0/16
    ) MASQ;
}
#EOF

I can't remember if the forward part is necessary; I've already turned
my brain off for the evening. Drat, I just wrote this whole long email
(see below) and realized that ferm thing probably will do you no good
with a dialup. I don't remember at the moment and don't have the time to
look it up now, but IIRC it has to do with diald. I'll try to come back
with more info later, but the rest of this email might be handy anyway
so I'll send it along...

Now, as to DHCP, the first question is do you really want dhcp? A static
address would be easier if you don't have a specific reason for wanting
dhcp. I'll assume you really do. Here's the interesting part from my
/etc/dhcp3/dhcpd.conf file:

option domain-name "fugal.net";
option domain-name-servers 128.187.22.200;
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.10 192.168.1.15;
  option routers 192.168.1.1;
}

Naturally you'll want your own values for domain and dns. This is
assuming your dialing up linux box is 192.168.1.1, and you want the
windows box to get dhcp'ed to something between 192.168.1.10 and
192.168.1.15. Also note that this restricts to serving out 6 addresses;
for the interested I put that in because sometimes I'm dumb and allow
dhcpd to start on both or the wrong interface and start serving out
addresses to my poor neighbors on resnet. At least this way only 6
neighbors have the mysterious inability to connect to the internet, and
OIT doesn't come looking for me.

HTH, let us know if you have any questions or problems.

P.S. for the interested in what that ferm thing is, "ferm compiles ready
to go firewall-rules from a structured rule-setup.  These rules will be
executed by the preferred kernel interface, such as ipchains(8) and
iptables(8)."
              
[EMAIL PROTECTED]:~$ ferm --lines --noexec /etc/ferm/just_nat 
iptables -F -t filter
iptables -F -t nat
iptables -F -t mangle
iptables -X -t filter
iptables -X -t nat
iptables -X -t mangle
iptables -t filter -A FORWARD -d 192.168.0.0/16 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j MASQUERADE


/* Quoth b c r <[EMAIL PROTECTED]>
   on Thu, 12 Feb 2004 at 21:14 -0500
   in <[EMAIL PROTECTED]> */

> 
> Hello.  i have a debian unstable box that i dial up with.  i also have a
> laptop running winxp.  i'd like to run dhcp server from the linux box so
> that i can also get internet on the laptop at the same time.  here's what
> i've done.
> 
> i apt-got  dhcp3-server and dhcp3-common
> 
> it then prompted me to edit some files, which i looked at, and am lost
> now.  i dont know where to start with google.  can someone give me a
> starter pointer?  has anyone done this before?
> thanks.
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> You are destined to become the commandant of the fighting men of the
> department of transportation.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> ____________________
> BYU Unix Users Group 
> http://uug.byu.edu/ 
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
> 

-- 
 .O.  Hans Fugal            | De gustibus non disputandum est.
 ..O  http://hans.fugal.net | Debian, vim, mutt, ruby, text, gpg
 OOO                        | WindowMaker, gaim, UTF-8, RISC, JS Bach
---------------------------------------------------------------------
GnuPG Fingerprint: 6940 87C5 6610 567F 1E95  CB5E FC98 E8CD E0AA D460

Attachment: signature.asc
Description: Digital signature

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to