Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-17-2001, 02:28 PM
|
#1
|
LQ Newbie
Registered: Oct 2001
Posts: 7
Rep:
|
dhcpd, smbd, nmbd, wdpd....
Ok, so wdpd are just my initials, but it follwos a nice chain...
I am trying to get both samba and dhcp to autmatically startup what I boot the machine. I have dhcp in the init.d boot for run-level 3 (default). When I boot it seems to go through the motions of starting it all up. But when I try to get an IP address from a Win9x mahine it times-out.
Also (related) something keeps dumping an entry into the route table (default 192.168.1.254...) I have to delete that and enter the right entry for the gateway. I *tried* to add this into the DHCP boot script with:
route del default
route add -net default gw x.x.x.x
But it doesn't seem to have an effect...
Basically it boils down to this... I want to start several services on boot... IP forwarding, DHCP, samba and ipchains. Ipchains hasn't had a problem.
I added the following to the IPChains script:
echo 1 > /proc/sys/net ipv4/ip_forward
With the hopes it would start IPv4 packet forwarding, I'll have to check on my latest boot, but I dont believe it did.
In /etc/init.d/dhcpd I added:
route del default
route add -net default gw x.x.x.x (x.x.x.x is the router for my ISP)
The script also contains:
daemon /usr/sbin/dhcpd eth1
to start dhcpd on eth1 device (the right device)...
I have been working with linux for about 2 weeks (Ok, I dabbled with it for about 3 months 2 years ago, but that doesn't count...) so go easy...
-Dizzy
|
|
|
10-18-2001, 03:31 AM
|
#2
|
Member
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132
Rep:
|
I guess you need to edit the file /etc/dhcpd.conf
Try man dhcpd.conf
Good Luck
|
|
|
10-18-2001, 05:15 AM
|
#3
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
for IP forwarding you'll need to set up iptables or ipchains as wel as enabling it in the kernel. The enabling line says it should do 'it', iptables will define what 'it' actually is.
|
|
|
10-18-2001, 08:55 AM
|
#4
|
LQ Newbie
Registered: Oct 2001
Posts: 7
Original Poster
Rep:
|
I found out that I had totally hosed my dhcpd script (in /etc/init.d) when I was trying to get it to do all the fancy crap...
I cheated and went into X-Windows and used the network setup to set the route table...
I then reinstalled the dhcpd rpm and that set my dhcpd script right again. Now everything boots fine, but the IP forwarding still won't come up. I have tried the following:
echo 1 > /proc/sys/net/ipv4/ip_forward
sh /etc/init.d/shipfwd
. /etc/init.d/shipfwd
(all these lines were in the dhcpd file in /etc/init.d)
The shipfwd basically contains the first line (that turns on IP forwarding...) but I always have to turn that on manually, and there ain't no way in hell I am coming in on a weekend to type one frickin line.
So... A couple of more things...
1) How do you create (and execute) a script on start-up (specifically for ip_forward in this case....)
2) I hate "cheating" in X-Windows, and I have another PC I am setting up for firewall use, and that one will be pretty poor at running X-Windows.... SOOO... What files control the listing of entries in the routing table?
3) I dont mean to kiss a** but Linux rocks and it is great to have a whole community of people to go to for help... Thanks guys!
|
|
|
10-18-2001, 09:03 AM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
there's no 'route.conf' file or whatever, the data in the routing table comes fro a number of different places. eg, the machines gateway is defined in /etc/sysconfig/network and each eth interface is defined in /etc/sysconfig/network-scripts/ifcfg-ethX and so forth...
you should add ip forwarding and such to the /etc/rc.local file, or rtather you can, there's loads of other places. you could write your own init.d scripts for it, seems a bit pointless really. I think the /etc/init.d/network script can deal with ip forwarding if you'cve already enabled it tho, for restarts etc...
for the forwarding, it's the echo..... line you want to use, that does the job, and then you've got iptables to suss, i did my one in one line, but i'm not near it now, so can't tell what it was.
|
|
|
10-18-2001, 10:25 AM
|
#6
|
Member
Registered: Sep 2001
Location: Bryan, Ohio USA (Home of the Etch-A Sketch)
Distribution: RedHat 7.1, 7.2, and 7.3
Posts: 76
Rep:
|
smbd
if you want samba to start automatically, log in as root, and go into linuxconf, in here there will be an option where you can specify what runs at start up, just set smb to run automatically at startup.
also, i was just thinking, to start ip_forward as 1 on start up etc. we might try using crontab? but that won't run it on boot, it'll only do it at certain points of the day. and i think the problem in that will be if you do a "service network restart" it disables ip_forward and crontab won't take effect til the next time. you could have it set to do that command every hour on the hour, or every half hour, but that might be a waste........i dunno
Last edited by Sathe; 10-18-2001 at 10:34 AM.
|
|
|
10-18-2001, 12:50 PM
|
#7
|
Member
Registered: Aug 2001
Location: Salt Lake City, UT
Distribution: REDHAT 7.1
Posts: 32
Rep:
|
IP FORWARDING
It seems to me there is a one liner where you can set NETWORKING=yes or NETWORKING=no and the scripts will set ip_forward accordingly.
|
|
|
10-18-2001, 12:56 PM
|
#8
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
crontab?? totally lost as to that one... You could do that if you want, but it's just about the least elegant solution i can imagine...
no the network service will take care of stopping and restarting the ip_forwarding, i'm sure i only have entries in /etc/rc.local and network restart stops and starts ip forwarding.
i'm pretty sure the NETWORK=yes/no line will simply control actucvation of the network interfaces, not ip_forwarding and such.
and i'd advise against using linuxconf at all costs, it kill everything. all that will do is create a symbolic link file in the approriate run level directory, somethign which any user should be happy enough to understand.
to do it yourself you should be able to just type somethign like...
ln -s /etc/init.d/smb /etc/rc3.d/S70smb
where the S70 part of the file name gives a notion of order and priority to the boot.
|
|
|
10-18-2001, 01:09 PM
|
#9
|
LQ Newbie
Registered: Oct 2001
Posts: 7
Original Poster
Rep:
|
JACKPOT
Ok, it is all running on boot now!
Here is what I did...
I added: "echo 1 > /proc/sys/net/ipv4/ip_forward" to the /etc/rc.local file. It works! No more worrying about it! Great guys, thanks acid (and others  ...
Next stop Samba-ville!
-Dizzy
|
|
|
10-18-2001, 06:05 PM
|
#10
|
Member
Registered: Sep 2001
Location: Bryan, Ohio USA (Home of the Etch-A Sketch)
Distribution: RedHat 7.1, 7.2, and 7.3
Posts: 76
Rep:
|
cool beans i'll have to try that when i get home
|
|
|
All times are GMT -5. The time now is 06:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|