LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Problem getting Internet on dual-NIC Slack 10.1 box (https://www.linuxquestions.org/questions/slackware-14/problem-getting-internet-on-dual-nic-slack-10-1-box-341499/)

Staedtler 07-09-2005 01:20 AM

Problem getting Internet on dual-NIC Slack 10.1 box
 
I'm trying to turn an older PC into a router/web server to use with my cable modem. I'll be hooking two Windows PCs into it through a hub. I used to do this with Redhat, and then FreeBSD ages ago, but they were giving me horrible hardware problems this time around, so here I am using Slackware 10.1.

The box has two NICs: eth0 -- a 3c503 card, and eth1 -- a 3c509 card. I'm going to make eth0 my "internal" interface, and eth1 the "external" interface. Therefore, I want to assign 192.168.1.1 to eth0, and set up eth1 using DHCP through my cable Internet provider.

I successfully set up the Ethernet driver modules for the two cards, and they are successfully detected on boot-up. They show up just fine using "ifconfig -a".

Here is where the problem begins. I started by setting up /etc/rc.d/rc.inet1.conf to assign a static IP to eth0, and DHCP to eth1 (I also left the gateway blank). When I do "rc.inet1 restart", I can see that a DHCP search runs automatically. If I use "ifconfig -a", I find that eth0 looks great, but eth1 has nothing assigned to it. If I use "dhcpcd eth1", it runs for about two minutes and returns to the prompt without any output. (I should also point out that the cable modem is connected to the right port on my Slack box. :-) )

Since DHCP was acting up, I decided to assign a static IP to eth1 (and a gateway address). I took the DHCP values from my Windows box and plugged them into rc.inet1.conf. I ran "rc.inet1 restart", then "ifconfig -a", and both interfaces had the right IP addresses.

At this point, I can ping 192.168.1.1 successfully, and my "external" IP address successfully (the one normally assigned by my provider using DHCP: 70.x.x.x), but I can't ping the Internet (ie. the provider's gateway, DNS servers, web servers, etc.).

So now I'm asking for help. :-) Sorry this is so long-winded, but I wanted to provide as much info as I can. Let me know if any more info would be helpful. (And right now I don't care about routing or even DHCP, I just want to get my Slack box talking to the Internet)

Thanks!

gbonvehi 07-09-2005 01:28 AM

I'm pretty sure you did this, but just in case, did you turn off/on the modem before booting into Linux? That should make DHCP ask for a new lease.

Staedtler 07-09-2005 01:54 AM

Quote:

Originally posted by gbonvehi
I'm pretty sure you did this, but just in case, did you turn off/on the modem before booting into Linux? That should make DHCP ask for a new lease.
I gave exactly what you suggested a try, but after rebooting, "ifconfig -a" still shows eth1 as having no IP address. eth1 isn't even up.

I'm still not convinced DHCP is the core of the problem, since manually configuring eth1 doesn't give me any Internet access.

keefaz 07-09-2005 03:33 AM

I would edit /etc/modules.conf (for kernel 2.4)
or /etc/modprobe.conf (for kernel 2.6) and add :
Code:

alias eth0 3c503
alias eth1 3c509

Then I would make sure /etc/rc.d/rc.inet1.conf contains :
Code:

IPADDR[0]="192.168.1.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]=""
...
GATEWAY="<provider's gateway>"

Then I would attempt a /etc/rc.d/rc.inet1 stop and
/etc/rc.d/rc.inet1 start

Staedtler 07-09-2005 01:25 PM

Quote:

Originally posted by keefaz
I would edit /etc/modules.conf (for kernel 2.4)
or /etc/modprobe.conf (for kernel 2.6) and add :
Code:

alias eth0 3c503
alias eth1 3c509


Hm... what does the "alias" line do?

Anyways, I did what you suggested -- I added those lines to /etc/modules.conf (it was empty before), and here is what my /etc/rc.d/rc.inet1.conf looks like:
Code:

IPADDR[0]="192.168.1.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""

IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]=""

GATEWAY="70.x.y.129"

(Naturally, "x" and "y" are real numbers in the file)

I ran "/etc/rc.d/rc.inet1 stop", and I got a message that dhcpcd was not running, then returned to the prompt. Then I ran "/etc/rc.d/rc.inet1 start", got a message that dhcpcd was working, and after 15 seconds came to the prompt. When I run "ifconfig -a", I see that eth0 is up with an address of 192.168.1.1, but eth1 has no IP address and is down.

Here's the alternative rc.inet1.conf I've also tried, based on the settings my Windows box gets from DHCP:
Code:

IPADDR[0]="192.168.1.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""

IPADDR[1]="70.x.y.151"
NETMASK[1]="255.255.255.128"
USE_DHCP[1]="no"
DHCP_HOSTNAME[1]=""

GATEWAY="70.x.y.129"

When I do a start/stop on rc.inet1, both eth0 and eth1 come up with the desired IP addresses. However, I can't ping the gateway ("destination host unreachable").

Staedtler 07-09-2005 02:30 PM

To try simplifying things, I've removed the 3c509 card from my system. Now I'm only using a 3c503, which appears as eth0. I've removed the 3c509 module from the kernel.

Still, I get the same problem. DHCP just won't work on eth0, and if I specify the right IP info, eth0 will be up, but won't talk to the gateway or the Internet. I can ping my own IP address just fine, and the traffic LED on the back of the card itself blinks happily, but there's a roadblock happening somewhere.

I considered an IRQ conflict, but using "cat /proc/interrupts" shows that eth0 is on IRQ 5, which isn't conflicting with anything (I have no sound card).

egag 07-09-2005 03:19 PM

just a guess...
do you have a nameserver in the /etc/resolv.conf ?
( should be smth like "nameserver <ip-of-isp> " )

egag

Staedtler 07-09-2005 03:28 PM

Quote:

Originally posted by egag
just a guess...
do you have a nameserver in the /etc/resolv.conf ?
( should be smth like "nameserver <ip-of-isp> " )

egag

resolv.conf doesn't contain any nameservers. I didn't think that would be necessary, since I've only been dealing with numeric IP addresses thus far. If my thinking is wrong, let me know. :-)

Staedtler 07-09-2005 03:29 PM

By the way, thanks to everyone who has made suggestions so far. I really appreciate the input, and I hope that more might be able to help me out here.

egag 07-09-2005 03:41 PM

well...if you tried only numerical ip adresses you're right.
but allow me another guess... :)

don't you have to login at your ips ?
( loginname & passwrd. )
i have a router that's doing that for me...

egag

Staedtler 07-09-2005 03:48 PM

Quote:

Originally posted by egag
don't you have to login at your ips ?
( loginname & passwrd. )
i have a router that's doing that for me...

egag

Well, this is a cable modem, so (as I understand) it's just TCP/UDP from here to the provider. You might be talking about PPPoE using a DSL modem; that usually requires a user/pass to set up the PPP connection.

Ultimately, my Windows box doesn't require giving a user/pass, or even specifying any particular host name, to access the Internet.

(Boy, I hope this cable modem doesn't have some kind of anti-Linux detection going on... :-/ )

egag 07-09-2005 03:57 PM

yip, i was thinking that way.
but if you normally connect without name&pwrd, it should all be ok.

i also remember reading smth. about the linux dhcpcd client being different
from the win. one. ?
( not sure about what was the prob. or solution then )
your prob. might be related to not being able to use dhcp.

Slackware also has dhclient, and i believe that's an alternative to dhcpcd.
but i never used it.
maybe take a look at that...

egag

Staedtler 07-09-2005 04:02 PM

Another update:

I've connected both my Windows box and Linux box to a hub. Both link up fine. I set the Linux box to 192.168.1.1/255.255.255.0, and the Windows box to 192.168.1.2/255.255.255.0.

Neither box can see the other. Pings from Windows to 192.168.1.1 fails, as do pings from Linux to 192.168.1.2.

So more and more it looks like the NIC in my Linux box just isn't working. :-/

egag 07-09-2005 04:06 PM

maybe try a setup with the 3c509 only...

egag

Staedtler 07-10-2005 04:08 PM

I've tried with jut the 3c503, 3c509, and with just a PCI Realtek 8139 card, but I get the same results with all of them.

Is it possible Slackware is running some kind of default network filter or firewall?


All times are GMT -5. The time now is 03:25 AM.