LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   "Default" ethernet port not responding to SSH any more (https://www.linuxquestions.org/questions/slackware-14/default-ethernet-port-not-responding-to-ssh-any-more-604397/)

agentc0re 12-04-2007 08:03 AM

"Default" ethernet port not responding to SSH any more
 
I have 2 NIC's on my server. I just recompiled the stock kernel and since then eth0, i cannot connect to the server via SSH, WINSCP, Webmin, or VMWARE console server. I can however do it on eth1. eth0 ip addy is what i added to dns and thats why i was using eth0. Both are static, and did not swap IP's. DNS still has the ip for eth0 and the dns name is pingable from another machine.

Im really stumped as to why this is happenning... would have figured if SSH port is listening that it would be listening on all eth's

my ifconfig
Code:

eth0      Link encap:Ethernet  HWaddr 00:1C:23:CC:5A:7D
          inet addr:10.30.0.45  Bcast:10.30.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:23ff:fecc:5a7d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:849189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39402 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:72540052 (69.1 MiB)  TX bytes:11578170 (11.0 MiB)
          Interrupt:16 Memory:f8000000-f8012100

eth1      Link encap:Ethernet  HWaddr 00:1C:23:CC:5A:7F
          inet addr:10.30.0.46  Bcast:10.30.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:23ff:fecc:5a7f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1389127 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4660375 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:167585908 (159.8 MiB)  TX bytes:2048435092 (1.9 GiB)
          Interrupt:16 Memory:f4000000-f4012100

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

part of netstat
Code:

tcp        0      0 *:time                  *:*                    LISTEN
tcp        0      0 *:902                  *:*                    LISTEN
tcp        0      0 *:netbios-ssn          *:*                    LISTEN
tcp        0      0 *:8333                  *:*                    LISTEN
tcp        0      0 *:10000                *:*                    LISTEN
tcp        0      0 *:auth                  *:*                    LISTEN
tcp        0      0 *:microsoft-ds          *:*                    LISTEN
tcp        0      0 *:8222                  *:*                    LISTEN
tcp6      0      0 *:http                  *:*                    LISTEN
tcp6      0      0 *:ssh                  *:*                    LISTEN
udp        0      0 *:biff                  *:*
udp        0      0 *:biff                  *:*
udp        0      0 lando.hearts:netbios-ns *:*
udp        0      0 10.30.0.46:netbios-ns  *:*
udp        0      0 *:netbios-ns            *:*
udp        0      0 lando.heart:netbios-dgm *:*
udp        0      0 10.30.0.46:netbios-dgm  *:*
udp        0      0 *:netbios-dgm          *:*
udp        0      0 *:10000                *:*
udp        0      0 *:time                  *:*
udp        0      0 *:time                  *:*


Not sure what else i could post that would help. i haven't changed any config files and i wouldn't even know which ones to change to have this occur.

marty_oc 12-04-2007 08:11 AM

What error do you get when you try to connect to say SSH on eth0? Is it connection refused, or timeout ?

I will also check IPTABLES or any firewall rules. Post output of iptables-save to have a look.

agentc0re 12-04-2007 10:06 AM

When i use putty and try to connect via SSH i get
Code:

Server Unexpectedly closed network connection
Not sure how to output the results of iptables-save. i was under the impression thats how you saved your iptables settings.

agentc0re 12-04-2007 10:58 PM

Another thing i've noticed is that eth1 has become my "default" ethernet port. everything by default is going in or out of that port now instead of eth0.

Any idea's why that might be happening?

zux 12-05-2007 04:02 AM

Quote:

Originally Posted by agentc0re (Post 2980574)
Another thing i've noticed is that eth1 has become my "default" ethernet port. everything by default is going in or out of that port now instead of eth0.

Any idea's why that might be happening?

it could be "default" just because the other one doesn't work, is the right module loaded? i have had problems if the 2 NIC's are same model and uses the same driver.
what does "iptables -L" say?

agentc0re 12-05-2007 07:29 AM

Quote:

Originally Posted by zux (Post 2980762)
it could be "default" just because the other one doesn't work, is the right module loaded? i have had problems if the 2 NIC's are same model and uses the same driver.
what does "iptables -L" say?

Crap, i didn't even think about that. Yes they are the same nic and use the same driver. im guessing there is no way around which one it decides as default to use at that point eh?

here's iptables output just for fun. :)
Code:

Chain INPUT (policy ACCEPT)
target    prot opt source              destination

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination


marty_oc 12-05-2007 08:07 AM

Quote:

Originally Posted by agentc0re (Post 2979875)
When i use putty and try to connect via SSH i get
Code:

Server Unexpectedly closed network connection
Not sure how to output the results of iptables-save. i was under the impression thats how you saved your iptables settings.

iptables-save fills standart output with iptables rules. If you run it alone with no parameters or redirections, you will get list of your rules. (practically the same result for this time as iptables -L)


But considering the message from putty, I think that there may be a problem with sshd.

Regarding the "same driver" issue - check lsmod, it will tell you, which driver is used. If you use some kind of hotplug manager, the modules should be loaded correctly and when you see the NICs in ifconfig, they must be loaded correctly.

Check sshd version - try updating sshd.

zux 12-05-2007 08:08 AM

iptables is not the problem.
i don't realy remember how it went with those 2 NIC's, only remeber that there were some strange problems. there is probably a way to get around this, unfortunately i can't help you.

agentc0re 12-06-2007 10:24 AM

Solved
 
I figured out the problem.

i was checking out my route table and the default gateway was set for eth1 not eth0!
once i changed it, everything worked as normal again.

PS anyone know how to edit my title so i can add "solved" ? tried editing my first post title and it didn't change the title displayed in the forums.

agentc0re 12-06-2007 10:38 AM

*puts foot in mouth

I think i spoke to soon, but i think i am on the right track.
Once i changed the default gw it did work and then it stopped working. default gateway is still there but i still have to use the other nic's ip to connect via ssh.

agentc0re 12-06-2007 10:47 AM

some investigating i've found this, but not sure if it is relevant.

route table from slack 12 box i'm having issues with
Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet        *              255.255.255.0  U    0      0        0 eth0
localnet        *              255.255.255.0  U    0      0        0 eth1
loopback        *              255.0.0.0      U    0      0        0 lo
default        10.30.0.1      0.0.0.0        UG    0      0        0 eth0

route table from slack 11 box.
Code:

Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
10.30.0.0      *              255.255.255.0  U    0      0        0 eth0
loopback        *              255.0.0.0      U    0      0        0 lo
default        10.30.0.1      0.0.0.0        UG    1      0        0 eth0

granted i don't have 2 nic's in the second machine, but i do find it weird that instead of localnet it says 10.30.0.0. not sure if this is an update from 11 to 12. i've deleted the route for eth0 completely and readded it, with no changes.

agentc0re 12-06-2007 11:35 AM

Alright, lets hope i don't have to stick my other foot in my mouth.

i had to have both in there, which makes sense.
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
localnet        *              255.255.255.0  U    0      0        0 eth0
localnet        *              255.255.255.0  U    0      0        0 eth1
loopback        *              255.0.0.0      U    0      0        0 lo
default        10.30.0.1      0.0.0.0        UG    1      0        0 eth1
default        10.30.0.1      0.0.0.0        UG    1      0        0 eth0


agentc0re 12-06-2007 11:43 AM

*Sticks other foot in mouth.... dang it!

it worked for a while and then quit. not sure what the deal is.

evilDagmar 12-07-2007 02:28 AM

Localnet is 127.0.0.0 which isn't something that should be on any interface but lo.

Use `route -n` instead.

No host is likely to do what you want it to on a IP network with two interfaces in the same netblock. This is a limitation of IPv4.

allend 12-07-2007 03:23 AM

I have noticed that with Slackware 12, if you have more than one NIC in a box, then the assignment of eth0 and eth1 (etc) can change from one reboot to the next. I suspect that this is due to different timings of the cards becoming available on the bus after initialising.
The solution is to assign eth0, eth1 etc to MAC addresses in /etc/udev/rules.d/network-devices.rules.


All times are GMT -5. The time now is 11:46 PM.