This project is read-only.

How to create a subinterface ?

May 8, 2012 at 9:41 AM


I would like to add a new interface to the router created on the tutorial.
I guess the easiest way to do so would be to create a subinterface (new IP address, netmask, etc.) and to add it to the router.

It seems rather easy but I can't get it to work :(

Has someone got a lead on how to perform this?


Thank you,

May 9, 2012 at 10:48 AM

Good Morning,

Are you trying to accomplish this task programatically or are you using the NetLab GUI?
What exactly are you trying to accomplish? Do you want to add a new IP address to an interface already created for the purpose of routing or do you want to add a completely new interface to your router witch has not yet been initialized?

with best regards,


May 9, 2012 at 7:06 PM
Edited May 9, 2012 at 7:08 PM

In fact, I programatically made a DHCP server using the DHCPServer class.
This server operates on a pool distributing addresses on the network.
The gateway for this network is

I linked this address to an "Ethernet" adapter like this:

if ( (ipInterface.AdapterType.ToString().Equals("Ethernet") ) && (!alreadyLinked))
                    ipInterface.AddAddress(ipPool0, maskPool0);
                    alreadyLinked = true;

//Then add it to the router and to our list


alreadyLinked is a boolean to make sure I linked the interface to only one adapter.

The DHCP server works well but dhcp clients can't ping IP addresses outside of their dhcp scope and I can't even seen the icmp request on the pcap capture made by the TrafficAnalyser lcpDumper.

I was thinking that maybe I used the wrong way to create a subinterface.

Thank you and best regards,

May 10, 2012 at 7:44 PM

Well, this looks more like a routing or address resolution problem.

Have you set the properties ipInterface.AutoAnswerARPRequests and ipInterface.PromiscousMode to true?

In case you want to ping hosts which are not directly connected to your machine, Is a correct default route to your gateway added to your router?

Since AutoAnswerARPRequests is not set in my tutorial code, I assume this could do the trick...

May 10, 2012 at 9:32 PM
Edited May 11, 2012 at 5:58 PM

Thank you so much emi !
I set the AutoAnswerARPRequests to true and the connectivity between my two subnets is now ok !

I should have detect this on Wireshark since the client got no answer to these ARP requests.

Just one more weird thing ! I can't access to the PromiscousMode property :s
I even regenerated the eExNetworkLibrary as I saw the property in the source code of EthernetInterace class. But while exploring the dll through Visual Studio, PromiscousMode doesn't show up :(
Do you know what can be the source of this problem?


I will try it from my workplace station tomorrow as I've got an older version of Visual Studio there.

Edit: same thing with an older version of Visual Studio (vs 2010).

May 17, 2012 at 1:20 PM

This is strange, since I cannot reproduce this problem here.

Are you sure you have the last version of the NetworkLibrary added to the references of your project?
Are you inspecting the correct class (eExNetworkLibrary.EthernetInterface, not IPInterface)?

regards, Emi