A twisted home network
There's plenty of information on how to install two network cards (done that), how to enable a FreeBSD box to run as a gateway, do NAT, DHCP, etc. However, I'm having a mental block with how the cards should be configured. Here's how I want my network setup- CABLE MODEM- D-link DI-701 Residential Gateway- FreeBSD NIC dc0 - FreeBSD NIC ep1 - hub - other computers... I'd like to leave the D-Link in place, since it has a built-in firewall and I'm not ready to start testing out my rules for ipfw. The D-Link assigns IP addresses Dynamically, or I can specify them statically. By default, the D-link has an IP address of 192.168.0.1 and the IP pool goes up from there. Where I get confused is how configure my network cards. Do I need a new IP prefix for the inner network? If the FreeBSD is a gateway, technically each NIC is connected to a different subnet, right? The card that will connect to the hub will need a Static IP address, since nothing is there to give an IP address. Does each NIC know of the other, or are the routing tables separate? This seems like a simple problem, but I've been scouring the handbook, freebsd diary, and the man pages, but I can't find any good examples. Thanks a bunch! Thaddeus To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: A twisted home network
Thaddeus Quintin wrote: There's plenty of information on how to install two network cards (done that), how to enable a FreeBSD box to run as a gateway, do NAT, DHCP, etc. However, I'm having a mental block with how the cards should be configured. Here's how I want my network setup- CABLE MODEM- D-link DI-701 Residential Gateway- FreeBSD NIC dc0 - FreeBSD NIC ep1 - hub - other computers... I'd like to leave the D-Link in place, since it has a built-in firewall and I'm not ready to start testing out my rules for ipfw. The D-Link assigns IP addresses Dynamically, or I can specify them statically. By default, the D-link has an IP address of 192.168.0.1 and the IP pool goes up from there. Where I get confused is how configure my network cards. Do I need a new IP prefix for the inner network? If the FreeBSD is a gateway, technically each NIC is connected to a different subnet, right? The card that will connect to the hub will need a Static IP address, since nothing is there to give an IP address. Does each NIC know of the other, or are the routing tables separate? This seems like a simple problem, but I've been scouring the handbook, freebsd diary, and the man pages, but I can't find any good examples. The reason that you're not seeing examples, is because the FreeBSD box is not needed in your setup. You could eliminate it altogether. I'm assuming your want to use it as a gateway so you can learn and eventually get rid of the d-link, so here's the easiest way. The physical layout you describe above is OK (as to what connects to what) Set up the dlink to be 192.168.0.1 and the dc0 card on the FreeBSD box to be 192.168.0.2 Disable DHCP on the dlink for the time being. Configure the ep1 nic on FreeBSD to be 172.16.0.1 ... be sure to enable forwarding on the FreeBSD box (gateway_enable=yes in rc.conf) The default gateway on the FreeBSD machine should be 192.168.0.1 Give the rest of your computers 172.16.0.* addresses with 172.16.0.1 as their gateway. Everything should work. When you're ready to remove the dlink, you'll change dc0 to get its IP from DHCP (from your ISP) and enable nat on the FreeBSD box. Then remove the dlink and plug the FreeBSD box directly into the cable modem. Be sure to adjust any firewall rules to match the changes in IP address. -- Bill Moran Potential Technologies http://www.potentialtech.com To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: A twisted home network
Hi, let's see here... (You should probably wait to get at least two responses since I am not feeling real confident about my description here... if they jive you're alright...) INET }--{ DLINK Thingie }--{ FBSD BOX }--{ Internal net Basically, the Dlink is going to get it's outside IP from whatever, be it DHCP, etc. The Inside will also have an IP address which I believe you said will be 192.168.0.1, right? Okay, now the freebsd box... Set the DLINK NIC (the NIC connecting to the DLINK box) to be 192.168.0.n where n is not the same as the DLINK. Set the default gateway for the DLINK NIC to be the DLINK Inside address. (Mine is using DHCP so I don't have a default_gateway setting in my rc.conf but if I remember from my DSL dialup days, you do set it) Set the inside NIC to be something different, say 10.0.0.1 set gateway_enable to YES (which I think you already did) for natd, set the natd_interface to be the DLINK NIC. (On mine I conveniently have the external nic is xl1 and the inside is xl0 so mine looks like this: gateway_enable=YES ifconfig_xl0=inet 192.168.1.18 netmask 255.255.255.0 ifconfig_xl1=DHCP [snip] natd_enable=YES natd_interface=xl1 natd_flags=-l -f /etc/natd.conf Now set all of your internal boxes to something matching the 10.0.0.n phrase where n is not the same as the inside NIC on your FreeBSD box. Okay, I think I can summarize this coherently... On the FreeBSD box, the two NICs sort of know about each other. You configure them independently, and slightly differently. On the NIC that goes to the outside, you set the default gateway explicitly. In the Inside NIC, you tell natd essentially what the default gateway is and natd handles the packets. (My natd.conf contains redirect directives mostly, I don't think it's usually necessary.) Rich. | Rich Fox | [EMAIL PROTECTED] | 86 Nobska Road | Woods Hole, MA 02543 | MA 508 548 4358 | VA 703 201 6050 On Fri, 31 Jan 2003, Thaddeus Quintin wrote: There's plenty of information on how to install two network cards (done that), how to enable a FreeBSD box to run as a gateway, do NAT, DHCP, etc. However, I'm having a mental block with how the cards should be configured. Here's how I want my network setup- CABLE MODEM- D-link DI-701 Residential Gateway- FreeBSD NIC dc0 - FreeBSD NIC ep1 - hub - other computers... I'd like to leave the D-Link in place, since it has a built-in firewall and I'm not ready to start testing out my rules for ipfw. The D-Link assigns IP addresses Dynamically, or I can specify them statically. By default, the D-link has an IP address of 192.168.0.1 and the IP pool goes up from there. Where I get confused is how configure my network cards. Do I need a new IP prefix for the inner network? If the FreeBSD is a gateway, technically each NIC is connected to a different subnet, right? The card that will connect to the hub will need a Static IP address, since nothing is there to give an IP address. Does each NIC know of the other, or are the routing tables separate? This seems like a simple problem, but I've been scouring the handbook, freebsd diary, and the man pages, but I can't find any good examples. Thanks a bunch! Thaddeus To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: A twisted home network
Thanks Mike! (and everyone else who replied!) It's ALMOST working I've got my other machines coming up with network access, but they don't seem to resolve DNS. I tried assigning DNS servers manually (the same ones that I use for my FreeBSD machine) (that led them to time out) and i've tried leaving them blank(instant failure). Is there something else that I need to set up? Thanks guys- Thaddeus On Fri, 31 Jan 2003, Mike Meyer wrote: In 188996853.1044039149@[192.168.0.2], Thaddeus Quintin [EMAIL PROTECTED] typed: There's plenty of information on how to install two network cards (done that), how to enable a FreeBSD box to run as a gateway, do NAT, DHCP, etc. However, I'm having a mental block with how the cards should be configured. Here's how I want my network setup- CABLE MODEM- D-link DI-701 Residential Gateway- FreeBSD NIC dc0 - FreeBSD NIC ep1 - hub - other computers... Where I get confused is how configure my network cards. Do I need a new IP prefix for the inner network? That's one way to solve it. You need two subnets. If the FreeBSD is a gateway, technically each NIC is connected to a different subnet, right? Right. In fact, FreeBSD gets upset if they aren't connected to different subnets. The card that will connect to the hub will need a Static IP address, since nothing is there to give an IP address. Right. Does each NIC know of the other, or are the routing tables separate? NICs don't have routing tables. The system has a routing table, and knows about both nics. This seems like a simple problem, but I've been scouring the handbook, freebsd diary, and the man pages, but I can't find any good examples. Call the dc0 side of the FreeBSD box subnet 0. Call the ep0 side subnet 1 . Let's use the same prefix (192.168) for all the subnets, and set up for 256 subnets of 256 hosts. The dlink is 192.168.0.1, so it's already right for subnet 0. Give the dc0 the IP address of 192.168.0.2. Or let dchp assign it to any value on 192.168.0.2. Ep1 is on subnet 1, so lets make it host 1, and give it the address of 192.168.1.1. The other hosts on subnet 1 must have addresses on 192.168.1. Their default router will be 192.168.1.1. The netmask for dc0, ep1 and all hosts on subnet 1 is 255.255.255.0. The dlink will need to know that the route to 192.168.1 is via 192.168.0.2. Without knowing details on it, I can't say how to set things up to give it that information. I also note that my dlink - a cable/DSL router - only understands 192.168.0 addresses. If that's the case, you'll have to subnet 192.168.0, not 192.168. as I just demonstrated. That would look like dc0 being 192.168.0.2, ep1 being 192.168.0.129, other on subnet 1 having last bytes greater than 130, and everybody having a netmask of 255.255.255.128. mike -- Mike Meyer [EMAIL PROTECTED]http://www.mired.org/consulting.html Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message
Re: A twisted home network
I fixed the DNS problem. I'm an idiot and typed the DNS addresses in wrong... Thanks for everyone that helped out! Thaddeus To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-questions in the body of the message