# dhcp with macvlan ?

## Gregoire

Hello,

my ISP gave me 3 public IP, I use one for a router that's connected to my PC on eth1 and one other on my PC with eth0.

I would like to use the third one also on eth0 and put a proxy (for example nylond) with it.

My current  /etc/conf.d/net

```

config_eth1=( "192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255" ) 

modules=("dhcpcd")

dhcp="nontp nonis"

config_eth0=( "dhcp" )

dhcpcd_eth0="-L -t 0"

macvlan_macvlan0="eth0"

mode_macvlan0="vepa"

mac_macvlan0="HERE I GIVE A VALID MAC DIFFERENT FROM ETH0..."

config_macvlan0=( "dhcp" )

dhcpcd_macvlan0="-L -t 0 -G -h penguin2"

dhcp_macvlan0="nontp nonis nodns"

```

And I have :

```

ll /etc/init.d/net*

lrwxrwxrwx 1 root root    6 Apr 17  2008 /etc/init.d/net.eth0 -> net.lo

lrwxrwxrwx 1 root root    6 Dec 26  2009 /etc/init.d/net.eth1 -> net.lo

-rwxr-xr-x 1 root root  17K Oct 23 10:19 /etc/init.d/net.lo

lrwxrwxrwx 1 root root    6 Dec 26  2009 /etc/init.d/net.macvlan0 -> net.lo

-rwxr-xr-x 1 root root 1.6K Oct 23 10:19 /etc/init.d/netmount

```

For a reason I don't understand just after boot I got :

```

ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet n.m.p.q  netmask 255.255.254.0  broadcast 255.255.255.255

        ether xx:xx:...  txqueuelen 1000  (Ethernet)

        RX packets 218645  bytes 288876102 (275.4 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 125035  bytes 11454548 (10.9 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 17  

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255

        ether xx:xx:...  txqueuelen 1000  (Ethernet)

        RX packets 81069  bytes 80671870 (76.9 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 64676  bytes 4156018 (3.9 MiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

        device interrupt 19  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436

        inet 127.0.0.1  netmask 255.0.0.0

        loop  txqueuelen 0  (Local Loopback)

        RX packets 1913  bytes 367714 (359.0 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 1913  bytes 367714 (359.0 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

macvlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        ether xx:yy:..  txqueuelen 0  (Ethernet)

        RX packets 306  bytes 18360 (17.9 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

And 

```

ps aux|grep dhc

root      3266  0.0  0.0   8556   360 ?        Ss   13:36   0:00 dhcpcd -L -t 0 -C ntp.conf -C yp.conf -m 2 eth0

```

Which seems to be only run for eth0.

Any idea on what I should change for having dhcp also for macvlan0 ?

Thank you very much !

----------

## MacGyver031

Hi,

I am not familiar with "macvlan", but short reading makes me believe that you should create two macvlans to achieve what you are looking for. I think that as soon as you assign the kernel-tcp-stack, the macvlan-tcp-stack is unable to "bind" on eth0.

BR.

----------

## Gregoire

I have also tried with two macvlans, but without any change.

Thank for your answer  :Smile: 

----------

