# manual link up



## webpr (May 11, 2017)

How link up via network driver (igb and ix) without connecting the cable?
I try manual set media, but i have status "no carrier" 
Can I disable auto-negotiation?


----------



## ShelLuser (May 11, 2017)

webpr said:


> How link up via network driver (igb and ix) without connecting the cable?
> I try manual set media, but i have status "no carrier"


Why? What are you trying to accomplish with that?  It sounds to me as if you're trying to fight symptoms while in fact you should be resolving the problem which caused those symptoms.



webpr said:


> Can I disable auto-negotiation?


Absolutely, but that probably has nothing to do with the "no carrier" error.

Auto-negotiation is basically used to set up the right speed and duplex mode for a network card. You could use ifconfig(8) to set up parameters such as media or mediaopts and depending on the driver for the network card you can also provide options for the driver itself through use of /boot/loader.conf.

For example: the rl(4) driver supports 10baseT/UTP and 100baseTX as media types and both full and half duplex (media options).

But something tells me that's not what you're looking for.


----------



## webpr (May 12, 2017)

ShelLuser said:


> Why? What are you trying to accomplish with that?


Education task.
It is necessary to organize one-way communication (for example, one fiber).




ShelLuser said:


> You could use ifconfig(8) to set up parameters such as media or mediaopts


I tried, but still have status "no carrier"


----------



## SirDice (May 12, 2017)

The carrier is done in hardware. So there's no software switch for it. You might be able to trick it using a loopback plug. 

http://www.juniper.net/documentatio...sk/operational/fe-ge-loopback-plug-rj-45.html


----------



## webpr (May 12, 2017)

SirDice said:


> You might be able to trick it using a loopback plug.


Already did so (for fiber too).
But the teacher rejected the concept, since its needs to be done software.


----------



## SirDice (May 12, 2017)

Tell your teacher it's technically not possible to get the carrier active without actually having a carrier active.


----------



## webpr (May 12, 2017)

netgraph can loop packet auto-negotiation?



SirDice said:


> Tell your teacher it's technically not possible to get the carrier active without actually having a carrier active.


Teacher linux fanat, linux have ethtool (autoneg off).


----------



## ShelLuser (May 12, 2017)

webpr said:


> Teacher linux fanat, linux have ethtool (autoneg off).


Auto negotiation has nothing to do with carrier detection.


----------



## aragats (May 12, 2017)

webpr said:


> linux have ethtool


It won't help either, just recently I tried to "solve" a similar problem with exotic hardware configuration without transformers at PHY's. Since I didn't know that there was a problem in hardware (missing pull-ups), I thought ethtool can help, but it kept showing NOCARRIER anyway.


----------



## gkontos (May 12, 2017)

In Linux you can create a dummy interface. Try googling that for FreeBSD also. However, there is no software way to trick a carrier active on an non active interface.


----------



## SirDice (May 12, 2017)

gkontos said:


> In Linux you can create a dummy interface. Try googling that for FreeBSD also.


I'll save you the search, if_tap(4):

```
The tap interface is a software loopback mechanism that can be loosely
     described as the network interface analog of the pty(4), that is, tap
     does for network interfaces what the pty(4) driver does for terminals.

     The tap driver, like the pty(4) driver, provides two interfaces: an
     interface like the usual facility it is simulating (an Ethernet network
     interface in the case of tap, or a terminal for pty(4)), and a character-
     special device ``control'' interface.  A client program transfers Ether-
     net frames to or from the tap ``control'' interface.  The tun(4) inter-
     face provides similar functionality at the network layer: a client will
     transfer IP (by default) packets to or from a tun(4) ``control'' inter-
     face.
```


----------



## webpr (May 13, 2017)

I tried to make a virtual switch (netgraph):
`ngctl mkpeer ix0: bridge lower link0
ngctl name ix0:lower br0
ngctl connect br0: ix0: link1 upper`
As before i have status "no carrier" 
netgraph can create full virtual network stack?


----------

