# HOW-TO Gentoo & vmware multi nics in non-promiscuous mode

## HeXiLeD

While ago i was having some issues on my one box home network with some applications and vmware due to the fact that by default and since everyone will just use one eth nic in the same box.

So i decided to try something different because  i had a few more eth nics.

The goal was to separate  the traffic that each operating system was doing and to avoid promiscuosity between all the virtual nics.

Since Vmware was using the same eth as gentoo; this was not possible.

So i decided to do some testing and questions as i posted here

the objective was this:

---------| GENTOO --> ETH0 --> CABLE --> ROUTER --> WAN/LAN 

BOX -- | 

---------| VMWARE --> GENTOO --> ETH1 --> ANOTHER CABLE --> ROUTER --> WAN/LAN

Steps:

a: gentoo network

b: vmware install and configuration

c: explanations

---

Hardware needed:

Router, 2 eth cables, box with 2 eth nics

setting up gentoo network

```
# nano /etc/conf.d/net
```

```
config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default gw 192.168.0.1" )
```

setting up the vmware network

```
config_eth1=( "192.168.0.3 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default gw 192.168.0.1" )
```

Creating eth* simlinks:

```
# cd /etc/init.d/

# ln -s net.lo net.eth0

# ln -s net.lo net.eth1
```

adding the ethernets to default run levels and start the network

```
# rc-update add eth0 default ; /etc/init.d/net.eth0 start
```

```
# rc-update add eth1 default ; /etc/init.d/net.eth1 start
```

Installing vmware:

```
#emerge app-emulation/vmware-workstation app-emulation/vmware-modules
```

Configuring vmware:

```
/opt/vmware/workstation/bin/vmware-config.pl
```

now, once here and to keep things simple for now you can just pick to do a simple network setting by using the bridged mode.

and you will create a /dev/vmnet0 that will use net.eth1.

Make sure that when asked what eth* to use for vmnet0; that  you will choose eth1, leaving eth0 just for gentoo.

once done vmware should bring up its network settings.

Adding vmware to default run levels

```
#rc-update add vmware default
```

run vmware, setup the other operating system dhcp settings and enjoy

Explanation:

Reasons why wanting to do this are simple. They can be due to stabilty, security and flexibility.

Here are a few examples:

- you might not have more than 1 computer to test and play around with things  that require more than 1 computer in a network

- you may need to do traffic analises to your box and if  all the operating systems are using the same eth card you will have touble separating what goes and comes from where. why not keep it clear and simple.

- you may have router policies and restrictions to the lan and wan based on static ip and mac address. in this case you may be limited with things that  you may want to do with vmware or  might have to keep changing gentoo eth0 all time to do what  you want to do.

either way this means to mess with gentoo network always.

Having 2 distinct eth cards working for each operating system you will ensure that gentoo network doesnt need to be touched and therefore it will be always stable and clean, while you can play with mac and ip settings on eth1 for the other operating system.

- you may wish  to have gentoo with restricted access to the wan while vmware on the DMZ

- you may want  to use gentoo in one wan network and vmware in another wan network on a different router with different wan ip

- you may want to have very tight firewall settings for gentoo (eth0) and something else set for vmware (eth1)

these are a few examples of what can be done while playing with this. you can push it even more by creating mini WAN's in one box only and with more ethernet cards.

For me the idea started with wanting to have stability, security and privacy in gentoo since the box is a workstation and runs a few servers.

On vmware  i play with whatever i want since testing other operating systems to use another WAN ip, to keep gentoo out of messy things.

Currently  i am running gentoo with some servers  like: http, https, ftps, secure and regular ircd, some eggdrops, sshd telnet and so on. 

And as a workstation i have 12 workspaces open with a few IM chat clients and other GUI applications and playing media.

At the same time vmware is running with windows 2003 and my current load as i write this is:   05:19:05 up  5:25,  4 users,  load average: 0.22, 0.24, 0.33

#uname -a 

2.6.16.19 #10 SMP Wed Oct 11 23:22:25 EDT 2006 x86_64 Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux 1 GB ddr2

I hope  this helps or brings something new to others to try and test.

----------

