Date: Fri, 9 Oct 1998 17:11:19 -0400 From: "Stephen A. Derdau" <sderdau@bit-net.com> To: "Jeffrey Bernt" <bernt@usa.net>, <freebsd-questions@FreeBSD.ORG> Subject: Re: DHCP Message-ID: <001f01bdf3c9$5cd3c380$030aa8c0@wookie.sderdau.ne.mediaone.net>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_001C_01BDF3A7.D5544680 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I think my situation is similar to your's .... I just got it going like 5minutes ago. I have a cable modem=20 I'm runnin isc-DHCP2 What you want to do is get that going. I had to set up this in my kernel I believe to get DHCP client to = work=20 Here is a good link on that. http://home.san.rr.com/freebsd/dhcp.html Now most stuff I found was on static ip addresses. I have a dynic ip address any way ...the link above helped me. **** I think what helped me is the /etc/resolv.conf file was finally = set up right . Make sure their set up right and see if you can get connected and = running. Now if you want to have a local network to connect also with only the = one ip connection check out natd and follow these instructions ....especially the one at = the bottom of the page...make sure you start natd once all is configured. Here is the part that helped me::::: RUNNING NATD The following steps are necessary before attempting to run natd: 1. Get FreeBSD version 2.2 or higher. Versions before this do = not sup=AD port divert(4) sockets. 2. Build a custom kernel with the following options: options IPFIREWALL options IPDIVERT Refer to the handbook for detailed instructions on building a = custom kernel. 3. Ensure that your machine is acting as a gateway. This can be = done by specifying the line gateway_enable=3DYES in /etc/rc.conf, or using the command sysctl -w net.inet.ip.forwarding=3D1 4. If you wish to use the -n or -interface flags, make sure that = your interface is already configured. If, for example, you wish to = spec=AD ify tun0 as your interface, and you're using ppp(8) on that = inter=AD face, you must make sure that you start ppp prior to starting = natd. 5. Create an entry in /etc/services: natd 8668/divert # Network Address Translation = socket This gives a default for the -p or -port flag. Running natd is fairly straight forward. The line natd -interface ed0 should suffice in most cases (substituting the correct interface = name). Once natd is running, you must ensure that traffic is diverted to = natd: 1. You will need to adjust the /etc/rc.firewall script to taste. = If you're not interested in having a firewall, the following = lines will do: /sbin/ipfw -f flush /sbin/ipfw add divert natd all from any to any via ed0 /sbin/ipfw add pass all from any to any The second line depends on your interface (change ed0 as = appropri=AD ate) and assumes that you've updated /etc/services with the = natd en=AD try as above. If you specify real firewall rules, it's best = to specify line 2 at the start of the script so that natd sees = all packets before they are dropped by the firewall. The firewall = rules will be run again on each packet after translation by natd, = minus any divert rules. 2. Enable your firewall by setting firewall_enable=3DYES in /etc/rc.conf. This tells the system startup scripts to run = the /etc/rc.firewall script. If you don't wish to reboot now, = just run this by hand from the console. NEVER run this from a virtual = ses=AD sion unless you put it into the background. If you do, you'll = lock yourself out after the flush takes place, and execution of /etc/rc.firewall will stop at this point - blocking all = accesses permanently. Running the script in the background should be = enough to prevent this disaster. SEE ALSO getservbyname(2), socket(2), divert(4), services(5), ipfw(8) AUTHORS This program is the result of the efforts of many people at = different times: Archie Cobbs <archie@whistle.com> (divert sockets) Charles Mott <cmott@srv.net> (packet aliasing) Eivind Eklund <perhaps@yes.no> (IRC support & misc additions) Ari Suutari <suutari@iki.fi> (natd) Brian Somers <brian@awfulhak.org> (glue) FreeBSD 15 April 1997 =20 -----Original Message----- From: Jeffrey Bernt <bernt@usa.net> To: freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG> Date: Friday, October 09, 1998 4:19 PM Subject: DHCP =20 =20 Help. I have my computer on a network, using a D-Link 220 (ne2000 = compatible) under FreeBSD 2.2.7, my network (through my dorm room) uses = dhcp. I can not get dhcp (wide or isc, both of which are in the = distribution cds) to work correctly. It will not even acknowledge that = the dhcp server is out there, nor will it assign me an IP. Should I just = ask for a specific IP and set my Fbsd box to that IP? Any help would be = greatly appreciated. Also, has anyone had luck with doing something like = this? Thanks. Jeff Bernt bernt@usa.net ------=_NextPart_000_001C_01BDF3A7.D5544680 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 = HTML//EN"> <META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR> </HEAD> <BODY bgColor=3D#d8d0c8> <DIV><FONT color=3D#000000 size=3D2>I think my situation is similar to = your's=20 ....</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>I just got it = going like=20 5minutes ago.</FONT></DIV> <DIV><FONT size=3D2>I have a cable modem </FONT></DIV> <DIV><FONT size=3D2></FONT><FONT size=3D2>I'm runnin = isc-DHCP2</FONT></DIV> <DIV><FONT size=3D2></FONT><FONT color=3D#000000 = size=3D2> What you=20 want to do is get that going.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2> I had to set up = this in my=20 kernel I believe to get DHCP client to work </FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Here is a good link on that. <A=20 href=3D"http://home.san.rr.com/freebsd/dhcp.html">http://home.san.rr.com/= freebsd/dhcp.html</A></FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>Now most stuff I found was on static = ip=20 addresses.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>I have a dynic = ip address=20 any way ...the link above helped me.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> **** I think what helped me is the = /etc/resolv.conf file=20 was finally set up right</FONT></DIV> <DIV><FONT size=3D2>. Make sure their set = up right=20 and see if you can get connected and running.</FONT></DIV> <DIV><FONT size=3D2>Now if you want to have a local network to connect = also with=20 only the one ip connection</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>check out natd and follow these instructions = ....especially=20 the one at the bottom</FONT></DIV> <DIV><FONT size=3D2>of the page...make sure you start natd once all is=20 configured.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Here is the part that helped me:::::</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV> </DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>RUNNING NATD<BR> The = following steps=20 are necessary before attempting to run natd:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 1. Get FreeBSD = version=20 2.2 or higher. Versions before this do not=20 sup­<BR> port=20 divert(4) sockets.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 2. Build a = custom kernel=20 with the following options:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p;=20 options=20 IPFIREWALL<BR>  = ; =20 options IPDIVERT</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT = size=3D2> Refer=20 to the handbook for detailed instructions on building a=20 custom<BR> =20 kernel.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 3. Ensure that = your=20 machine is acting as a gateway. This can be=20 done<BR> by = specifying the=20 line</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p;=20 gateway_enable=3DYES</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT = size=3D2> in=20 /etc/rc.conf, or using the command</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p; sysctl=20 -w net.inet.ip.forwarding=3D1</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 4. If you wish = to use the=20 -n or -interface flags, make sure that=20 your<BR> interface = is=20 already configured. If, for example, you wish to=20 spec­<BR> ify = tun0 as=20 your interface, and you're using ppp(8) on that=20 inter­<BR> = face, you=20 must make sure that you start ppp prior to starting natd.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 5. Create an = entry in=20 /etc/services:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p;=20 natd = 8668/divert #=20 Network Address Translation socket</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT = size=3D2> This=20 gives a default for the -p or -port flag.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> Running natd is fairly = straight=20 forward. The line</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> natd -interface = ed0</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> should suffice in most = cases=20 (substituting the correct interface name).<BR> = Once natd=20 is running, you must ensure that traffic is diverted to = natd:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 1. You will = need to=20 adjust the /etc/rc.firewall script to taste. =20 If<BR> you're not=20 interested in having a firewall, the following lines=20 will<BR> = do:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p;=20 /sbin/ipfw -f=20 flush<BR> &nbs= p;=20 /sbin/ipfw add divert natd all from any to any via=20 ed0<BR> = =20 /sbin/ipfw add pass all from any to any</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT = size=3D2> The=20 second line depends on your interface (change ed0 as=20 appropri­<BR> = ate) and=20 assumes that you've updated /etc/services with the natd=20 en­<BR> try as = above. If you specify real firewall rules, it's best=20 to<BR> specify = line 2 at=20 the start of the script so that natd sees=20 all<BR> packets = before=20 they are dropped by the firewall. The firewall=20 rules<BR> will be = run=20 again on each packet after translation by natd,=20 minus<BR> any = divert=20 rules.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 2. Enable your = firewall=20 by setting</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> &nbs= p;=20 firewall_enable=3DYES</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT = size=3D2> in=20 /etc/rc.conf. This tells the system startup scripts to run=20 the<BR> = /etc/rc.firewall=20 script. If you don't wish to reboot now, just=20 run<BR> this by = hand from=20 the console. NEVER run this from a virtual=20 ses­<BR> sion = unless=20 you put it into the background. If you do, you'll=20 lock<BR> yourself = out=20 after the flush takes place, and execution=20 of<BR> = /etc/rc.firewall=20 will stop at this point - blocking all=20 accesses<BR> =20 permanently. Running the script in the background should be=20 enough<BR> to = prevent this=20 disaster.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>SEE ALSO<BR> = getservbyname(2), =20 socket(2), divert(4), services(5), = ipfw(8)</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>AUTHORS<BR> This program is = the result=20 of the efforts of many people at different<BR> =20 times:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> Archie Cobbs <<A=20 href=3D"mailto:archie@whistle.com">archie@whistle.com</A>> (divert=20 sockets)<BR> Charles Mott <<A=20 href=3D"mailto:cmott@srv.net">cmott@srv.net</A>> (packet=20 aliasing)<BR> Eivind Eklund <<A=20 href=3D"mailto:perhaps@yes.no">perhaps@yes.no</A>> (IRC support & = misc=20 additions)<BR> Ari Suutari <<A=20 href=3D"mailto:suutari@iki.fi">suutari@iki.fi</A>>=20 (natd)<BR> Brian Somers <<A=20 href=3D"mailto:brian@awfulhak.org">brian@awfulhak.org</A>> = (glue)</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT=20 size=3D2> FreeBSD &nb= sp; &nbs= p; =20 15 April 1997 </FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV> </DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: = 5px"> <DIV><FONT face=3DArial size=3D2><B>-----Original = Message-----</B><BR><B>From:=20 </B>Jeffrey Bernt <<A=20 href=3D"mailto:bernt@usa.net">bernt@usa.net</A>><BR><B>To: </B><A = = href=3D"mailto:freebsd-questions@FreeBSD.ORG">freebsd-questions@FreeBSD.O= RG</A>=20 <<A=20 = href=3D"mailto:freebsd-questions@FreeBSD.ORG">freebsd-questions@FreeBSD.O= RG</A>><BR><B>Date:=20 </B>Friday, October 09, 1998 4:19 PM<BR><B>Subject:=20 </B>DHCP<BR><BR></DIV></FONT> <DIV><FONT color=3D#000000 size=3D2>Help. I have my computer on a = network, using=20 a D-Link 220 (ne2000 compatible) under FreeBSD 2.2.7, my network = (through my=20 dorm room) uses dhcp. I can not get dhcp (wide or isc, both of which = are in=20 the distribution cds) to work correctly. It will not even = acknowledge that=20 the dhcp server is out there, nor will it assign me an IP. Should I = just ask=20 for a specific IP and set my Fbsd box to that IP? Any help would be = greatly=20 appreciated. Also, has anyone had luck with doing something like=20 this?</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2>Thanks.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2>Jeff Bernt</FONT></DIV> <DIV><FONT color=3D#000000=20 size=3D2>bernt@usa.net</FONT></DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_001C_01BDF3A7.D5544680-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001f01bdf3c9$5cd3c380$030aa8c0>