using netgraph to create a pair of pseudo ethernet interface

Marko Zec zec at icir.org
Mon Dec 17 10:03:41 PST 2007


On Monday 17 December 2007 14:15:45 zhouyi zhou wrote:
> Dear All,
>     Any one know how to us netgraph to create a pair of pseudo
> ethernet interface. The packet go out from one and in another.

tpx32# ngctl mkpeer eiface ether ether
tpx32# ngctl mkpeer eiface ether ether
tpx32# ngctl l
There are 3 total nodes:
  Name: ngctl1446   Type: socket          ID: 00000006   Num hooks: 0
  Name: ngeth1      Type: eiface          ID: 00000005   Num hooks: 0
  Name: ngeth0      Type: eiface          ID: 00000003   Num hooks: 0
tpx32# ngctl connect ngeth0: ngeth1: ether ether
tpx32# ngctl l
There are 3 total nodes:
  Name: ngctl1448   Type: socket          ID: 00000008   Num hooks: 0
  Name: ngeth1      Type: eiface          ID: 00000005   Num hooks: 1
  Name: ngeth0      Type: eiface          ID: 00000003   Num hooks: 1
tpx32# 


More information about the freebsd-net mailing list