# Bring eth0 up without assigning IP

## Magnum_

How can this be achieved?

If I don't mention a thing about eth0 in /etc/conf.d/net, it just uses dhcpcd to obtain an IP.

Situation :

Gentoo box with 2 NICs, configured as VMWare server 2.0.

Cable modem ==> Eth0 ==> Eth1 ==> Switch ==> Clients

I would like to configure a VM to route my internet access for the clients, without having my gentoo box obtain an external IP address (which seems the safest way?). In any case, my provider only provides one external IP address, so if eth0 takes up the IP, the VM wont be connected.   So eth0 should remain without configuration, but it must be "up". A bridged vmnet interface will take up the IP address provided by the DHCP server from my provider. This vmnet interface will be used only by 1 VM.

Hm. My english is not good enough to explain it any clearer =) I hope you understand what I'm trying to do here...

Is this possible? Is it good practice?

Is it enough to just provide a dummy static private IP in the /etc/conf.d/net file?

----------

## poly_poly-man

this, I believe, is impossible. You need a connection on your real interface to make a connection behind the real interface - a connection includes an IP address and the ability to "speak" to others on the subnet.

Your best bet, assuming you want to do this (which isn't really a great idea - I mean, why bother?) is to set up an iptables or similar rule on the host to send all traffic on that interface to the virtual machine...

----------

## Mad Merlin

It's possible to do this, just set eth0 as a network bridge (which need not have an IP), then plug your VM into the bridge. That might be tricky with VMWare though, as it doesn't create a tap device for each VM.

----------

## cyrillic

 *Magnum_ wrote:*   

> Cable modem ==> Eth0 ==> Eth1 ==> Switch ==> Clients 

 

This part looks good.  It seems like you are trying to build a Gentoo router.

You can get some helpful hints here : Home Router Guide

I am not sure where VMWare fits into the picture ... sounds like excess baggage to me.

----------

## freaky

Wouldn't know how to do it exactly in gentoo, but used to run vmware server on ubuntu. You should be able to find a script you can add lines to. On my system (but i use unstable (and hence baselayout-2))  there is /etc/conf.d/local to which you could add it. All you'd need to run is 'ifconfig eth0 up', there's no need for an IP address on it whatsoever.

----------

## Magnum_

Thank you, that brings up my eth0 without assigning an IP.

----------

## Magnum_

Thank you, that brings up my eth0 without assigning an IP.

Another trick :  add config_eth0=( "null" ) to your /etc/conf.d/net

 :Smile: 

----------

