LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-17-2001, 02:28 PM   #1
dizzydench
LQ Newbie
 
Registered: Oct 2001
Posts: 7

Rep: Reputation: 0
Question 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
 
Old 10-18-2001, 03:31 AM   #2
Sylhouette
Member
 
Registered: Oct 2001
Location: Beverwijk (Holland
Distribution: Red Hat 7.1
Posts: 132

Rep: Reputation: 15
I guess you need to edit the file /etc/dhcpd.conf

Try man dhcpd.conf

Good Luck
 
Old 10-18-2001, 05:15 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 10-18-2001, 08:55 AM   #4
dizzydench
LQ Newbie
 
Registered: Oct 2001
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up

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!
 
Old 10-18-2001, 09:03 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 10-18-2001, 10:25 AM   #6
Sathe
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: Reputation: 15
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.
 
Old 10-18-2001, 12:50 PM   #7
[BHBS]=TK
Member
 
Registered: Aug 2001
Location: Salt Lake City, UT
Distribution: REDHAT 7.1
Posts: 32

Rep: Reputation: 15
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.
 
Old 10-18-2001, 12:56 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 10-18-2001, 01:09 PM   #9
dizzydench
LQ Newbie
 
Registered: Oct 2001
Posts: 7

Original Poster
Rep: Reputation: 0
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
 
Old 10-18-2001, 06:05 PM   #10
Sathe
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: Reputation: 15
cool beans i'll have to try that when i get home
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
smbd and nmbd aproan Linux - Networking 1 02-05-2005 07:19 PM
smbd and nmbd missing PhilHalf Linux - General 1 01-28-2003 07:55 AM
smbd and nmbd artman62 Linux - Networking 3 06-27-2002 06:14 PM
smbd and nmbd iquadri1 Linux - Networking 0 09-29-2001 01:41 PM
xinetd and smbd/nmbd suselinux Linux - Networking 3 09-05-2001 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration