# Cisco slowly initializes its network port.



## ogogon (Nov 17, 2011)

My computer with FreeBSD connected to the Cisco switch.

Unfortunately, the initialization of the ports in Cisco very slow - tens of seconds.
By the time my computer starts to adjust your system timer by NTP, the Cisco port is not yet ready for use.

How can I correct this problem?

Can I get ifconfig to check the initialization of the opposite port?
Can you another way to perform the delay, except for changes to existing scripts?

Ogogon.


----------



## SirDice (Nov 17, 2011)

ogogon said:
			
		

> Unfortunately, the initialization of the ports in Cisco very slow - tens of seconds.


Sounds like a pretty bad switch or at least configured badly. It certainly isn't my experience with Cisco switches.

I'd search for the solution on the switch, not the client.


----------



## ogogon (Nov 17, 2011)

SirDice said:
			
		

> Sounds like a pretty bad switch or at least configured badly. It certainly isn't my experience with Cisco switches.
> 
> I'd search for the solution on the switch, not the client.


Not new, but highly advanced Cisco have always been slowpoke.
I am afraid that it's easier to do something with the client.

Ogogon.


----------



## wblock@ (Nov 17, 2011)

Use SYNCDHCP in the ifconfig line in /etc/rc.conf.  Or netwait if it's a static IP address.


----------



## DutchDaemon (Nov 17, 2011)

I have seen this problem with Cisco switches (esp. the managed ones) quite frequently. Sometimes I have to *ping* from a newly connected machine to a host behind the switch for a minute before replies start coming in. I don't quite remember whether I had to put the NICs in 'autoselect' mode or use precise settings in /etc/rc.conf. Experiment with both, i.e. with and without explicitly setting 'media' and 'mediaopt' parameters in ifconfig statements.


----------



## ogogon (Nov 17, 2011)

wblock@ said:
			
		

> Use SYNCDHCP in the ifconfig line in /etc/rc.conf.  Or netwait if it's a static IP address.


Apparently, netwait - this is what I need.

Unfortunately, it does not exist in the system, nor in the manual and documentation.
He is in /usr/src/etc/rc.d/.

How to properly install and where it manual?

Ogogon.


----------



## fefo (Nov 17, 2011)

ogogon said:
			
		

> My computer with FreeBSD connected to the Cisco switch.
> 
> Unfortunately, the initialization of the ports in Cisco very slow - tens of seconds.
> By the time my computer starts to adjust your system timer by NTP, the Cisco port is not yet ready for use.
> ...



It seems to me like STP problem (it takes 30s for classic STP to put up interface).
If this is your case, just shut down STP on ports connected to end devices like PC/router.. It make sense to have it enabled only on ports, which are connected to other switches.

Second option is to change classic STP to RSTP (rapid spanning-tree protocol).

(do *show running-config* on your manageable switch, comment all private parts and paste it here  )


----------



## wblock@ (Nov 17, 2011)

No manual, AFAIK.  Worse yet, I'm not even sure where it should be documented.  But you can find the values in /etc/defaults/rc.conf.  So, in /etc/rc.conf:

```
netwait_enable="YES"
netwait_ip="192.168.1.1"
netwait_if="em0"
```


----------



## bbzz (Nov 18, 2011)

It's funny you guys are blaming cisco here. Their devices require above average networking proficiency or frustrations will arise.

@ogogon
You need portfast on switch to make its port go directly to spanning tree forwarding mode. Under interface mode just type in:


```
spanning-tree portfast
```

Don't disable Spanning-tree protocol.

@fefo
Even with RSPT you still need portfast to elect edge ports, due to backward compatibility with STP.


----------



## Orum (Nov 20, 2011)

wblock@ said:
			
		

> No manual, AFAIK.  Worse yet, I'm not even sure where it should be documented.


Actually this is mentioned in rc.conf(5), which I think would be an appropriate place.



			
				bbzz said:
			
		

> @ogogon
> You need portfast on switch to make its port go directly to spanning tree forwarding mode.


Or he can tweak the timers (which is what I do with STP).  Though, whichever he decides, he should understand the potential consequences of it before doing it.


----------



## wblock@ (Nov 20, 2011)

Orum said:
			
		

> Actually this is mentioned in rc.conf(5), which I think would be an appropriate place.



Doh.  I'm glad it's in there, though.


----------



## bbzz (Nov 20, 2011)

Orum said:
			
		

> Or he can tweak the timers (which is what I do with STP).  Though, whichever he decides, he should understand the potential consequences of it before doing it.



Nowadays, if you run more than one switch you should be running RSTP anyway, which means you don't deal with timers. There is no real reason to touch those timers. The point of portfast port is that it has end host connected to it.


----------

