# upgrade from hub to switch

## muhsinzubeir

Well, I have been bizzi since yesterday to replace a hub which connects my webserver and fileserver.Unfortunately, I havent come up with any solid clue so far why the webserver rejects to get connected to the network when I use the switch.

The switch is here, I am more thinking of software issue as the device works fine tested with 2 computers so far that fileserver and my laptop.

Thanks for the help, if you need more data pls let me know.Here are some few data of the webserver while connected using hub:

#cat /etc/conf.d/net

 *Quote:*   

> config_eth0=( "dhcp" )
> 
> modules_eth0=( "ifplugd" )
> 
> 

 

#ifconfig *Quote:*   

> 
> 
> eth0      Link encap:Ethernet  HWaddr 00:50:8b:e9:59:30  
> 
>           inet addr:192.168.1.6  Bcast:192.168.1.127  Mask:255.255.255.128
> ...

 

----------

## alex.blackbit

 *muhsinzubeir wrote:*   

> ... why the webserver rejects to get connected to the network when I use the switch.

 

what exactly does "connected" mean?

does your machine think it has a physical connection? i.e. a cable connected, or not? watch the logs when you plug in/out.

net-misc/ethercard-diag should be helpful too, but i never used it.

----------

## szczerb

Maybe the port on the switch that you're trying to connect the server to is borked?

Anyway, give us some more info about your network's topology and how exactly the problem manifests, because it seems like it's getting an adress. Or is it the one to give addresses?

----------

## muhsinzubeir

 *Quote:*   

> what exactly does "connected" mean? 

 

I mean nothing happened, it doesnt get IP.Even if  I try manually to give it IP address like ifconfig eth0 192.168.1.10/25 it will take the new IP address but not connected to the network.

 *Quote:*   

> 
> 
> Maybe the port on the switch that you're trying to connect the server to is borked? 

 

I dont think so as the same port that doesnt work for the webserver, does work well with other machines on the same port.

Topolgy:

==>Router incl.Wifi and dhcp server 

||==>3com switch (fileserver+webserver)

||==>Wifi-laptops

||==>desktops

P:S

***Not sure if that diagram clear, but the router(4ports) connects laptops, desktops, and 3Com switch which holds the 2 servers fileserver && webserver.

***Let me go plugin a monitor to those machines in there and see if I can find something else

Thanks for the input.....

----------

## szczerb

Maybe you accidentally set more then one interface of the network with the same mac? And the switch ignores the second one instead of sending it both ways or going into hub mode like it should? And are you sure the cable is healthy? Other then that I have no idea...

EDIT switch -> hubLast edited by szczerb on Wed Jun 17, 2009 11:46 am; edited 1 time in total

----------

## ndse2112

Are your interfaces and/or switch ports hardcoded to a speed/duplex or are they set to autoneg?

Try setting the interfaces in your machine to autoneg and see if they will get a link.

----------

## muhsinzubeir

I think I have found the problem, but still dont know how to solve.

I think with the 3Com switch, a slight delay happened and the dhcplient get a weard IP address(old lease or something).I have seen this on the messeages generate as it can be seen here below:

 *Quote:*   

> Jun 17 18:12:48 webserver ifplugd(eth0)[7700]: Exiting.
> 
> Jun 17 18:12:50 webserver ifplugd(eth0)[11123]: ifplugd 0.28 initializing.
> 
> Jun 17 18:12:50 webserver ifplugd(eth0)[11123]: Using interface eth0/00:50:8B:E9:59:30 with driver <e100> (version: 3.5.23-k6-NAPI)
> ...

 

----------

## muhsinzubeir

 *ndse2112 wrote:*   

> Are your interfaces and/or switch ports hardcoded to a speed/duplex or are they set to autoneg?
> 
> Try setting the interfaces in your machine to autoneg and see if they will get a link.

 

can you explain more, i havent set anything...i just bought that switch and decide to replace my hub.Which I basically suspect it to be a little bit slow....

but the upgrade goes as you can see in the thread...my webserver get wrong IP address   :Evil or Very Mad: 

PS

Trying to unmerge any dhcp stuffs...

----------

## ndse2112

Jun 17 18:18:45 webserver ifplugd(eth0)[11123]: Link beat detected.

Jun 17 18:18:47 webserver ifplugd(eth0)[11123]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.

Jun 17 18:18:48 webserver ifplugd(eth0)[11123]: client: eth0: dhcpcd 4.0.7 starting

Jun 17 18:18:48 webserver dhcpcd[13017]: eth0: dhcpcd 4.0.7 starting

Jun 17 18:18:48 webserver ifplugd(eth0)[11123]: client: eth0: broadcasting for a lease

Jun 17 18:18:48 webserver dhcpcd[13017]: eth0: broadcasting for a lease

Jun 17 18:18:50 webserver ifplugd(eth0)[11123]: client: eth0: carrier lost

Jun 17 18:18:50 webserver dhcpcd[13017]: eth0: carrier lost

Jun 17 18:19:08 webserver ifplugd(eth0)[11123]: client: eth0: timed out

Jun 17 18:19:08 webserver ifplugd(eth0)[11123]: client: [A[72C [34;01m[ [31;01m!![34;01m ][0m

Jun 17 18:19:08 webserver ifplugd(eth0)[11123]: client: [A[72C [34;01m[ [31;01m!![34;01m ][0m

Jun 17 18:19:08 webserver ifplugd(eth0)[11123]: Program executed successfully.

Jun 17 18:19:08 webserver ifplugd(eth0)[11123]: Link beat lost. 

From these few messages, it doesnt look like that nic is staying linked with your switch. The 169.254.x.x is the APIPA range (Automatic Private IP Address). An address out of that space will be assigned to the interface when the interface cannot get a response from the dhcp server.

Do the NIC and the switch link lights stay on when you plug your nic into the switch?

Can you try a different cable?

You can use a tool like mii-tool or ethtool (sys-apps/net-tools and/or sys-apps/ethtool) to look at the link status of the interface:

callisto ~ # mii-tool eth0

eth0: negotiated 1000baseT-FD flow-control, link ok

callisto ~ # ethtool eth0

Settings for eth0:

	Supported ports: [ TP ]

	Supported link modes:   10baseT/Half 10baseT/Full 

	                        100baseT/Half 100baseT/Full 

	                        1000baseT/Half 1000baseT/Full 

	Supports auto-negotiation: Yes

	Advertised link modes:  10baseT/Half 10baseT/Full 

	                        100baseT/Half 100baseT/Full 

	                        1000baseT/Half 1000baseT/Full 

	Advertised auto-negotiation: Yes

	Speed: 1000Mb/s

	Duplex: Full

	Port: Twisted Pair

	PHYAD: 1

	Transceiver: internal

	Auto-negotiation: on

	Supports Wake-on: g

	Wake-on: d

	Current message level: 0x000000ff (255)

	Link detected: yes

callisto ~ #

----------

## muhsinzubeir

Thanks man....

I will have to look at it tomorrow....enough ambarrasment of this switch for today...

I really didnt expect this, I am also thinking that I might quit for a while on that webserver....to reduce costs and maintance headache...

----------

## muhsinzubeir

I took that webserver to  my living room and make connection directly to the router is OK...using hub also OK...only the via the switch is NO GOOD tried different cables, different tools, net-setup,no luck...mmh 

**Running emerge -avuDN world on that webserver, no idea but some weard stuffs happening in there.Not cable nor the switching nor router nor MAC conflicts.May be the upgrade will bring some good   :Smile:  .

**Integrated webserver into fileserver, and put my website back online for the moment.

P:S

If the switch totally fails, then the server will have to off and used only for maintance issues or backup in the near future when I have time to upgrade its hardware.It does have pretty old stuffs in there pent III   :Very Happy: 

May be this is for learning purposes if I run 

 *Quote:*   

> ifconfig eth0 192.168.1.10/25

 , it looks from ifconfig that the IP you manually give is submitedd to the machine...but normally I dont get connection as if there is another file that these DHCP software updates.I would guess it would be /etc/resolv.conf....but this file is normally there which is left by the DHCP clients...am I missing something on this manual procedure?

----------

## alex.blackbit

muhsinzubeir,

as i already wrote before, please find out if the box thinks it has a physical connection or not.

run (as root): "tail -f /var/log/everything/current" or "tail -f /var/log/messages", depending on your syslog daemon and then plug the cable in.

that should bring some light on the situation.

----------

## muhsinzubeir

 *alex.blackbit wrote:*   

> muhsinzubeir,
> 
> as i already wrote before, please find out if the box thinks it has a physical connection or not.
> 
> run (as root): "tail -f /var/log/everything/current" or "tail -f /var/log/messages", depending on your syslog daemon and then plug the cable in.
> ...

 

I think yes, the machine think there is a link but the machine doesnt get correct data using DHCP.

Normally I get all my machines online with DHCP server, but not this time   :Evil or Very Mad: 

connect cables with the switch:

 *Quote:*   

> tail -f /var/log/messeges

 

 *Quote:*   

> 
> 
> Jun 18 17:55:14 webserver dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
> 
> Jun 18 17:55:17 webserver dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
> ...

 

```
mii-diag eth0
```

 *Quote:*   

> Basic registers of MII PHY #1:  3000 782d 02a8 0154 05e1 45e1 0001 0000.
> 
>  The autonegotiated capability is 01e0.
> 
> The autonegotiated media type is 100baseTx-FD.
> ...

 

```
ethtool eth0
```

 *Quote:*   

> 
> 
> eth0: negotiated 100baseTx-FD flow-control, link ok
> 
> Settings for eth0:
> ...

 

Edit:

System hangs when entering runlevel 3 at starting point of eth0 after kernel upgrade.Aaagh I will look at this later on, taking a break on the issue....

----------

