Can I create a virtual network interface to connect to a real network device?

0

I have a networked windows pc with 2 network interfaces. The first connects to a lan with ip address 10.1.. The second connects to another lan with ip address 10.2..

Maybe it's a dumb question, however is it possible to virtualize the second network interface, so that the pc can connect to the 2 lans?

If necessary, I may switch to linux or paravirtualization.

CLARIFICATION:

I want to send DHCP broadcast packets on the second lan, but not on the first lan. I want to do it with one single physical network interface. At the moment, I'm not using any virtualization software.

FURTHER CLARIFICATION:

I have a device, which lives on the second lan, that requires a DHCP address on boot. I want my pc to respond on the second lan because on the first lan there is another DHCP server. This is the very reason for the whole "second lan" requirement: to avoid competition between DHCP servers.

michelemarcon

Posted 2012-03-23T09:15:44.817

Reputation: 185

I think you are going to need to provide more information. You have stated that you have a windows PC connected to two networks, and you want the PC to connect to both networks. Do you mean you want a VM to connect to the two networks? If so, please state what VM software you are using. – Paul – 2012-03-23T09:32:36.467

Answers

1

A PC with two network interfaces, each connected to a distinct LAN, should be able to communicate with both LANs without need for virtualisation and without needing any special configuration.

RedGrittyBrick

Posted 2012-03-23T09:15:44.817

Reputation: 70 632

I forgot to add, I want to get rid of the second ethernet card, which is the point of virtualizing it – michelemarcon – 2012-03-23T09:55:22.287

0

If both IP subnets are available on the same Ethernet LAN, then it's trivial to configure most OSes to have more than one IP configuration (address, mask, gateway) on the same Ethernet port.

If the two IP subnets are one separate Ethernet LANs that are virtual LANs on the same switch (or can be made to be VLANs on the same switch), then you could configure the PC's port on the switch to carry both VLANs. Maybe one would be untagged (native) and the other would be tagged (that is, packets for the other network would have the VLAN header on them).

Either way, it's totally doable in most OSes.

Spiff

Posted 2012-03-23T09:15:44.817

Reputation: 84 656

0

No problem at all; you don't even need to mess with "virtual" network interfaces. Just broadcast to 10.2.255.255/255.255.0.0. That's the netmask associated with the second network interface.

[edit] See this documentation how this works in practice (your DHCP server probably uses a different configuration format, but the idea is the same)

MSalters

Posted 2012-03-23T09:15:44.817

Reputation: 7 587

I've updated my requirements, sorry for the confusion. – michelemarcon – 2012-03-23T13:10:07.263