Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

natd, ipfw problems

Status
Not open for further replies.

jacksplat

Programmer
Jun 19, 2001
67
US
i'm trying to setup up my linux box to act as a router and connect my ms desktop to it. i want to run a ftp or webserver on my linux box and i've found some info about doing this. I've built my own kernel and i can send out a ping, but i can't recieve any packets back. people can view my webpage when i have it up and get onto my ftp, but my ms desktop can't get connected to the internet. when it is booting up, it says can't send message on x10. I think that it is x10, might be xl0, cause i just noticed that ed0, do0, lo0 etc all r 2 letters then a #. I tried to change all the x10's to xl0's and that didn't help. I'm not sure what else to do. I feel like i'm very close and all i need is 1 thing changed to make this work.
 
I didn't know people used ipfw on Linux. Are you sure you want to discuss this in the FreeBSD forum? Why not the Linux forum? -------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
i'm using freebsd, it might not be natd, i'm just used to calling it natd.
 
completely forgot u said ipfw, today is not a good day...its actually my friend who is trying to get this server up. I'm 99% sure hes using ipfw, and its not linux, its freebsd
 
OK, so it is a FreeBSD box. The original post was a little confusing, but I think I have it now ;-).

natd is the daemon that runs when you are using FreeBSD for network address translation, and 'ipfw' is one of the firewalls through which natd can be filtered.

So, you have a FreeBSD machine, and the kernel has been recompiled to support ipfw, and you are running a natd gateway, and you have two network cards; an ed0 and an xl0 (yes, it is with an "L" not a number one).

I take it you have configured one card for the external network, connecting to your DSL or Cable modem, while the other card is running a private IP address, such as 192.168.1.1, or 10.1.1.1, and you have that one connected to a LAN hub to act as a server for your Windows machine. Right so far?

What is the output of the command "ifconfig -a" (you can X out your external IP address; in fact, please do). Also, where are you initializing natd? In rc.local? What is your init script for natd and ipfw?

Are you trying to use the DHCP server to provide an IP address to your Windows machine, or are you assigning an IP address manually?

At the very minimum, you need the following:

1. have both network cards configured in rc.conf (if you set them up from the install interface, or from /stand/sysinstall, they should both be in rc.conf). One card should be for the external address, and one should have an IP address in a private range.

2. have the kernel compiled for ipfw support

3. have a startup script that calls natd, and at least a minimal ipfw rules script. If your firewall rules are very simple, they can even reside right in a startup script, such as /etc/rc.local

4. Have your Windows box connected to the hub, either with an appropriate IP address assigned, or as a DHCP client, if your server is running DHCP.

-----

Here is an example /etc/rc.local startup script, using interface "ed0" as your external IP address, with minimal firewall rules that will pretty much allow anything from your local network to connect to the web. (if you are concerned about security, you shouldn't just rely on this basic ruleset):

natd -interface ed0

/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
-------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
hehe my friend just realized that he needed to use crossover wire between the 2k box and the bsd box. hehe it works now. also, i forgot to mention that i like ur quote, being as how i failed calc 3 last semester and am taking it over again now.
 
God is in the details...

LoL -- I got that sig quote from my professor back when I was retaking Calc I. (no need to ask how long ago that was...) This same student apparently also couldn't get over the idea that factorial notation used an exclamation point, as if to really emphasize something. -------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top