Date: Mon, 16 Jul 2001 12:01:49 -0700 (PDT) From: Joey Garcia <bear@buug.homeip.net> To: <net@freebsd.org>, <questions@freebsd.org> Subject: Help needed with setting up routing Message-ID: <20010716115150.H80369-100000@localhost>
next in thread | raw e-mail | index | archive | help
Hello all! Okay, I'm still having a bit of problems setting up a FreeBSD router. I'm not sure if FreeBSD forwards the packets automatically or if I need to add routes to the routing table or what. Here's what I'm trying to do. I have 3 networks: 192.168.0.0/24, 192.168.10.0/24, and 192.168.20/29. I have one FreeBSD box with one interface having these addresses: 192.168.0.8, 192.168.10.100, and 192.168.20.1 (with corresponsing netmasks stated above). I also have clients on each of the networks. If I were to draw it out, I guess it would looke a bit like this: ---------- 192.168.0.8/24 | bsd | 192.168.10.100/24 ---------- 192.168.20.1/29 | | --------------------------------------- | | | | | | ----- ----- ----- |PC1| |PC2| |PC3| ----- ----- ----- 192.168.0.50/25 192.168.10.200/24 192.168.20.50/29 Granted, this is a very simple view. There are hubs thrown in there, and there also is another router that routes 192.168.0.0/24 to the internet. At this time I just wanted to get these 3 subnets talking then I'll experiment with getting them going out on the Internet. So basically, I'd like to get those machines talking to each other. So far, I can make PC1 ping all the IP addresses on the router, but I can't get it to ping PC2 or PC3 (and vice-versa). I have read through the Handbook, at it seems what I'm trying to do here is called a multi-homed host. Althouh, there wasn't much of an explanation how to accomplish on what I'd like to do. I have also read through the manpage for route and came across something concerning if the destination is directly reachable (I guess that means there are no hops in between), then I use the -interface modifier. I'm not quite sure on how to properly use the route add command with the -interface modifier. Some assistance would be appreciated. (Then again, that's probably not what I need to do in this case) I'm really inexperienced when it comes to routing. The only routes I've ever fiddled with was 'route add default ipaddress' when it came to setting up my Internet connectivity. I guess I should now provide the mandatory ifconfig and netstat -rn information for my machine. Here it is: ifconfig: tl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet6 fe80::280:5fff:feb6:3731%tl0 prefixlen 64 scopeid 0x1 inet 192.168.0.8 netmask 0xffffff00 broadcast 192.168.0.255 inet 192.168.20.1 netmask 0xfffffff8 broadcast 192.168.20.7 inet 192.168.10.100 netmask 0xffffff00 broadcast 192.168.10.255 ether 00:80:5f:b6:37:31 media: autoselect (10baseT/UTP) status: active netstat -rn: Internet: Destination Gateway Flags Refs Use Netif Expire 127.0.0.1 127.0.0.1 UH 0 94 lo0 192.168 link#1 UC 0 0 tl0 => 192.168.10 link#1 UC 0 0 tl0 => 192.168.20/29 link#1 UC 0 0 tl0 => Okay, not sure what other peices of information I can help out with but I have set net.inet.ip.forwarding to 1 and I'm not running routed (do I need to?). From reading the manual page I gathered that the routes are directly reachable because all 3 networks lie on the same interface. Therefore, I believe I need to use the -iface modifier. I have tried commands such as this with no luck: route add -net 192.168.10.0 -iface (and other combinations) I'd really appreciate any help. I guess I need some pointers on how to properly use the route command as well as how to properly route to 3 different networks on the same interace. TIA, Joey To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010716115150.H80369-100000>