LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-05-2004, 12:41 AM   #1
captain_bogus
LQ Newbie
 
Registered: Apr 2003
Location: Houston, Texas
Distribution: Slack 9.1 - 2.6.6
Posts: 21

Rep: Reputation: 15
Gateway / DHCP Server problem on Slackware


Hi,

I know many people have asked similar questions but I have not been able to find an answer for this. I'm trying to set up my slackware box as a router. I don't want to get a router specific distro, and I don't want to buy a router.

I have 2 nics in my Slackware box. eth0 lined up to my Roadruner cable modem (Toshiba). eth1 lined up to my XP box. The Slackware box can see the internet just fine, but the XP box tells me that my network cable is unplugged.

When I line up the XP box to the cable modem directly it works just fine.

I dled, compiled and installed dhcpd from isc.org. I used their example for my dhcpd.conf:

# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
# Sample /etc/dhcpd.conf
# (add your comments here)
ddns-update-style ad-hoc;
default-lease-time 600;
max-lease-time 7200;
#
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.200 192.168.100.240;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.100.255;
option routers 192.168.100.3;
option domain-name-servers 192.168.100.3;
option domain-name "mydomain.cxm";
option ip-forwarding on;
option netbios-node-type 8;
}

But what I think is my problem is my eth1...When I type ifconfig -a I get:

eth0 Link encap:Ethernet HWaddr 00:50:BA9:C3:89
inet addr:24.27.71.172 Bcast:255.255.255.255 Mask:255.255.240.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52665 errors:0 dropped:0 overruns:0 frame:0
TX packets:1128 errors:0 dropped:0 overruns:0 carrier:0
collisions:82 txqueuelen:100
RX bytes:3987914 (3.8 Mb) TX bytes:194357 (189.8 Kb)
Interrupt:5 Base address:0xf000

eth1 Link encap:Ethernet HWaddr 00:60:08:27:82:3F
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:10 Base address:0x1040

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4684 (4.5 Kb) TX bytes:4684 (4.5 Kb)

Finally, when I type dhcpd eth1 -d -f I get "Not listening for connection on any interface."

Any ideas? I'm stumped.

Thanks,
captain_bogus
 
Old 06-05-2004, 01:33 AM   #2
larry
LQ Newbie
 
Registered: Mar 2004
Location: chicago
Distribution: Fedora 2, Slackware 9.1, Debian 3.0
Posts: 16

Rep: Reputation: 0
k looks like multiple issues:

1: eth1 does not have a network address. try this:
Code:
ifconfig eth1 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0
this will setup eth1 to communicate with your local network

2. that dhcpd.conf is not for you. try using this:

Code:
default-lease-time 3600;        # 24h
max-lease-time 86400;           # 24h
 
subnet 192.168.1.0 netmask 255.255.25.0 {
 
        range 192.168.1.10 192.168.1.150;    #obviously the range of ips to use
 
        option subnet-mask 255.255.255.0;     #subnet mask to give to dhcp client
        option broadcast-address 192.168.1.255;    #broadcast address to give client
 
        option routers 192.168.1.1;        #this is your router (eth1 if you configure it like above)
        #option domain-name-servers 206.141.239.142;    #uncomment this and add your isp's dns server
        #option domain-name-servers 192.168.1.1;       #unless your like me and have your own or have a second one
        option domain-name "domain.com";         #this is the domainname that will be given out
}
3.
Quote:
eth1 lined up to my XP box
d00d i hope you dont mean you connected one end to the slackbox and the other end to the xp box. i am going to pretend you didnt and are using a hub or switch.

the only thing left is to make sure the xp box nick is set to full dhcp. you should not have to assign anything to it. it should obtain everything from your dhcp server.

of course there is an easier way by not using dhcp but hey if this doesnt work let me know.

hell let me know anyway

--larry

thats what i get for not previewing!

Last edited by larry; 06-05-2004 at 01:35 AM.
 
Old 06-05-2004, 02:24 AM   #3
larry
LQ Newbie
 
Registered: Mar 2004
Location: chicago
Distribution: Fedora 2, Slackware 9.1, Debian 3.0
Posts: 16

Rep: Reputation: 0
yah i just thought of something else.

you are going to have to set up ip forwarding/masquerading on the router as well. this can be a detailed subject but you might be able to get by on doing this:

Code:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
otherwise read up on this here

--larry
 
Old 06-05-2004, 06:01 PM   #4
captain_bogus
LQ Newbie
 
Registered: Apr 2003
Location: Houston, Texas
Distribution: Slack 9.1 - 2.6.6
Posts: 21

Original Poster
Rep: Reputation: 15
ok, I did all that. I WAS lining up my XP box directly to my Slackware box, lol. Since nothing I had read said how to line things up I assumed that you could hook up two nics and they could talk to one another. I inserted a hub/switch. To be clear I lined up the Slackware box to the uplink in the hub and put the XP box on "X1". Now my XP box does not say the ethernet cable is unplugged.

Here is my ifconfig -a:

eth0 Link encap:Ethernet HWaddr 00:50:BA:D9:C3:89
inet addr:24.27.71.172 Bcast:255.255.255.255 Mask:255.255.240.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44437 errors:0 dropped:0 overruns:0 frame:0
TX packets:1031 errors:0 dropped:0 overruns:0 carrier:0
collisions:54 txqueuelen:100
RX bytes:3107099 (2.9 Mb) TX bytes:156717 (153.0 Kb)
Interrupt:5 Base address:0xf000

eth1 Link encap:Ethernet HWaddr 00:60:08:27:82:3F
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:10 Base address:0x1040

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:96 errors:0 dropped:0 overruns:0 frame:0
TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5184 (5.0 Kb) TX bytes:5184 (5.0 Kb)

And my route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
255.255.255.255 * 255.255.255.255 UH 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
24.27.64.0 * 255.255.240.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 24.27.64.1 0.0.0.0 UG 0 0 0 eth0

I typed in "route add -host 255.255.255 dev eth1" because the guide on isc.org said all Windows clients need it. The XP box didn't work with or without it.

I wasn't sure what to put in for my "option.domain.server"...here is the contents of my resolv.conf:

nameserver 24.28.99.63
nameserver 24.28.99.64
nameserver 24.93.40.77
search houston.rr.com

I just used the first one. Here is my current dhcpd.conf:

#/etc/dhcpd.conf from larry@linuxquestions.org 6/5/2004
default-lease-time 3600; # 24h
max-lease-time 86400; # 24h
ddns-update-style ad-hoc;
subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.10 192.168.1.150; #obviously the range of ips to use

option subnet-mask 255.255.255.0; #subnet mask to give to dhcp client
option broadcast-address 192.168.1.255; #broadcast address to give client

option routers 192.168.1.1; #this is your router (eth1 if you configure it like above)
option domain-name-servers 24.28.99.63; #uncomment this and add your isp's dns server
#option domain-name-servers 192.168.1.1; #unless your like me and have your own or have a second one
option domain-name "mydomain.com"; #this is the domainname that will be given out
}


Larry, you said there is an easier way than using DHCP, what do you mean? I'm game for easier. I just want to be able to see the internet on both my machines without buying a router.

I appreciate your help.

Thanks,
captain_bogus
 
Old 06-05-2004, 06:36 PM   #5
larry
LQ Newbie
 
Registered: Mar 2004
Location: chicago
Distribution: Fedora 2, Slackware 9.1, Debian 3.0
Posts: 16

Rep: Reputation: 0
ok your almost there.

take the slack box out of the uplink spot and just put it in normal slot (X2 ?). This should allow your xp box to obtain a ip from your slackbox. from there we can see if there are any other issues (ie. masquerading).

the easier way (also after you move the cable of the slack box):

setup your xp box like this:

ip: 192.168.1.2
mask: 255.255.255.0
broadcast address: 192.168.1.255
default gateway: 192.168.1.1
DNS : 24.28.99.63

that is it. then you need to setup masqerading. try the example from above first and let me know.

--larry

ps
Quote:
I typed in "route add -host 255.255.255 dev eth1" because the guide on isc.org said all Windows clients need it.
there is no reason for this.
 
Old 06-05-2004, 07:20 PM   #6
captain_bogus
LQ Newbie
 
Registered: Apr 2003
Location: Houston, Texas
Distribution: Slack 9.1 - 2.6.6
Posts: 21

Original Poster
Rep: Reputation: 15
EXCELLENT!!! As soon as I took the line out of the uplink and put it in a regular spot, my XP firewall detected an "intrusion attempt" from my slackbox, lol! I double clicked IE and it worked. Thank you so much.

A related question. The commands:

ifconfig eth1 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
dhcpd eth1

Where could I put those so that they exeute on start up and does it matter in which order they execute?

Thanks,
captain_bogus
 
Old 06-05-2004, 07:50 PM   #7
larry
LQ Newbie
 
Registered: Mar 2004
Location: chicago
Distribution: Fedora 2, Slackware 9.1, Debian 3.0
Posts: 16

Rep: Reputation: 0
best way thing to do is throught them into a file. Maybe create a file /etc/rc.d/rc.netshare (or sumthin) and put all that into it. do
Code:
 chmod 755 /etc/rc.d/rc.netshare
(to make it executable) .then at the end of /etc/rc.d/rc.local put /etc/rc.d/rc.netshare. This way everytime the computer is restarted it will be executed.

As far as order goes, just make sure to do the ifconfig first. Otherwise you will have nothing to reference the other commands to.

Hey im glad it worked. Now go and spread the wealth!!

--larry
 
Old 06-07-2004, 11:07 AM   #8
captain_bogus
LQ Newbie
 
Registered: Apr 2003
Location: Houston, Texas
Distribution: Slack 9.1 - 2.6.6
Posts: 21

Original Poster
Rep: Reputation: 15
The solution works perfectly. Thank you for all your help!

I have a new (seemingly unrelated?) problem that has resulted since implementing the solutions above. In X I can hit alt-F1 to AltF6 to get a command line terminal, right? Well for some reason F2 through F5 are locked up. There is a blinking cursor at the top of the screen but typing doesn't do anything. there is no text on the screen asking forr a log-on. Luckily F6 still works. I can log-on as normal. Any idea what this is?

Thanks,
captain_bogus
 
Old 06-10-2004, 10:45 AM   #9
kennedy01
LQ Newbie
 
Registered: Nov 2003
Location: Georgia
Distribution: Slackware 10.1
Posts: 28

Rep: Reputation: 15
Resolution, did dhcpd ever work?

Curious if you ever got dhcpd running so that the XP box was set to dynamically get an IP?
 
Old 06-15-2004, 10:43 AM   #10
captain_bogus
LQ Newbie
 
Registered: Apr 2003
Location: Houston, Texas
Distribution: Slack 9.1 - 2.6.6
Posts: 21

Original Poster
Rep: Reputation: 15
kennedy01,

Yes, I never had to change settings on the XP box. Once I lined up the hub correctly it started right up.

captain_bogus
 
Old 10-06-2004, 11:17 PM   #11
Diademed
Member
 
Registered: Jul 2004
Distribution: Slackware 10.2
Posts: 159

Rep: Reputation: 30
This thread got me working too!!!! w00t!!!! heh, sorry, it's a spur of the moment, bliss bump!
 
Old 11-25-2008, 02:28 PM   #12
NightSky
Member
 
Registered: Sep 2001
Location: Texas :(
Distribution: Slackware64-13.37
Posts: 776

Rep: Reputation: 50
Good DHCP Server Thread

Thanks for the xmas gift 2 Quick ques. can I use 2Wiregateway with this setup? Will this give me a usable website address with my dynamic is add?
Thanks much, I learn with these types of threads!

Last edited by NightSky; 11-25-2008 at 09:25 PM. Reason: Found my second gigabit pci lan card!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Help in setting up Gateway, DHCP and DNS Server depam Linux - Software 1 10-06-2005 12:52 PM
DHCP, Gateway and DNS server depam Linux - Networking 3 10-05-2005 08:33 PM
sles 9.2 dhcp server not assigning default gateway pat45 Linux - Networking 1 05-07-2005 06:51 AM
DHCP and gateway routing problems (simple noob problem) michaelsanford Linux - Networking 4 04-13-2005 03:17 PM
Setting up a gateway/dhcp server. chaosego Linux - Wireless Networking 33 09-26-2004 08:50 AM


All times are GMT -5. The time now is 03:20 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration