how to assign two IPs on same NIC
I am using Fedora Core7. Can Anybody help me to assign two IP addresses on same NIC.
Arvind |
Behold the power of GOOGLE! :D
http://technodigits.wordpress.com/20...card-in-linux/ |
With static IP-addresses is just to define them.
With DHCP it's not possible |
Quote:
Quote:
Code:
auto eth0 Well I had some time when I got home from work to check out if you could have DHCP on both for sure, it seems we were both half right. I couldn't get DHCP to work on both the primary and sub-interface at the same time, but I had no problem having DHCP on the primary interface and static on the sub-interface. I was going by some linux lessons I have, and the instructor said it could be done. If it can, I wasn't able to get it to work. |
|
Subnet interface ? What's that ?
Is each "subnet interface" defined with there own unique MAC address ? If "YES" then: How do you configure the MAC address for the second MAC address for subnet interface 2 ? If "NOT", the DHCP server can't delivery more than one IP-address to each MAC-address (on the DHCP client discovery request from the host) ? If each subnet interface has one unique MAC address, the DHCP server see each MAC address as different host's ! Quote:
|
"Virtual IP-address" ?! ...there is a lot of strange definitions....
It's only to define more than one IP-addresses per physical interface. But, still all IP-addresses are using the same MAC address on one physical Ethernet interface. Quote:
|
I belive "Virtual IP-address" and subnet interface is the same !
Then each physical Ethernet interface has only one MAC address, then it's possible to only use one ( and only one) IP-address with DHCP per phsical Ethernet interface. But, maybe someone could write a new NIC-driver and emulate several virtual NIC cards by using serveral MAC addresses per physical Ethernet interface. If the operating system detect several NIC card, it also support one IP-address per virtual interface used with DHCP. |
Perhaps I can clear some things up. The process described in the two articles above (which one article calls “Virtual IP-addresses”) is more correctly known as ip aliasing. Using this method, you may add multiple aliases to a network device. All alias devices (whose names consist of the base device, followed by a colon and the alias number) share the same MAC as the base device and all such interfaces will come down (and be deleted) when the base device is brought down.
If you want to have one physical network device with multiple MAC addresses (each of which in turn may have its own IP address and zero or more aliases), you may use something called VLAN Tagging (described in the IEEE802.1Q standards document). To do this on linux, you’ll need the 8021q module loaded (unless it’s compiled into the kernel). Once you create a VLAN tag (with the userspace utility vconfig), you can change its link address the same way you change the link address of a normal interface. In fact, you can even bring the interfaces up and down independently of each other. You should be careful that the new MAC does not conflict with any other MAC addresses in your network. Here is an example of using 802.1Q tagging to get multiple MAC addresses (as well as IP addresses) on a single device. Once you have separate MAC addresses, you should be able to use DHCP to configure both each tag separately. |
Code:
mate ~ # ifconfig eth0:0 hw ether 00:00:00:00:00:01 |
Quote:
For example (using ifconfig): Code:
# ifconfig |
All times are GMT -5. The time now is 02:55 AM. |