Setting Static IP on bridged network - Fusion/Centos

225 views
Skip to first unread message

Jeff MacDonald

unread,
Sep 15, 2014, 12:59:21 PM9/15/14
to vagra...@googlegroups.com
HI,

I'm trying to set a static ip address on my public_network. My home network is 10.0.1.0/24 and I'd like the host to be on that.

My line inside my Vagrantfile is as follows:

config.vm.network "public_network", ip: "10.0.1.111"

When i run vagrant up && vagrant ssh  then ifconfig -a, a new interface eth1 is created however its clearly getting its ipaddress via DHCP.

eth1      Link encap:Ethernet  HWaddr 00:0C:29:78:F7:1F
          inet addr:10.0.1.215  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe78:f71f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:316 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:28658 (27.9 KiB)  TX bytes:1236 (1.2 KiB)

[vagrant@localhost ~]$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
[vagrant@localhost ~]$ cat !$
cat /etc/sysconfig/network-scripts/ifcfg-eth1
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
BOOTPROTO=dhcp
ONBOOT=yes
DEVICE=eth1
#VAGRANT-END

So, vagrant is ignoring the IP address for public networks.

My environment is as follows:

Host : Mavericks
Guest : Centos 6.5
Vagrant: 1.6.5
Using the VMWare Fusion provider.

Thoughts?

Jeff.






Jeff MacDonald

unread,
Sep 15, 2014, 2:59:02 PM9/15/14
to vagra...@googlegroups.com
Likewise if you do the same thing with a Ubuntu 14.04 basebox, it appears to hang at ==> default: Configuring network adapters within the VM... for quite some time.

jeff.

Jeff MacDonald

unread,
Sep 15, 2014, 3:19:33 PM9/15/14
to vagra...@googlegroups.com
Okay. Eventually Ubuntu does come up but attempts to setup en1 with DHCP as well, just like centos.

If DHCP for public_networks is the only way it works, thats fine but the documentation seems to say it works otherwise..


Jeff.

Alvaro Miranda Aguilera

unread,
Sep 15, 2014, 9:41:32 PM9/15/14
to vagra...@googlegroups.com
whats the full output of ifconfig -a ?

is not the same ip segment used in eth0 ?

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff MacDonald

unread,
Sep 16, 2014, 10:52:42 AM9/16/14
to vagra...@googlegroups.com
Here are the relevant parts. The new inteface is the same subnet as my homes public network, however it uses DHCP and will not set static ip.

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether 40:6c:8f:40:e0:fd
nd6 options=1<PERFORMNUD>
media: autoselect (none)
status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 7c:d1:c3:72:6a:62
inet6 fe80::7ed1:c3ff:fe72:6a62%en1 prefixlen 64 scopeid 0x5
inet 10.0.1.205 netmask 0xffffff00 broadcast 10.0.1.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
en4: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=60<TSO4,TSO6>
ether d2:00:10:cf:0c:80
media: autoselect <full-duplex>
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr 00:3e:e1:ff:fe:0c:f0:c8
nd6 options=1<PERFORMNUD>
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether 42:6c:8f:04:f3:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en4 flags=3<LEARNING,DISCOVER>
       ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive

--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/1XZXcG4n_oc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
If my reply seems terse or short, it's nothing personal.
Jeff MacDonald
je...@bignose.ca

Alvaro Miranda Aguilera

unread,
Sep 16, 2014, 5:29:49 PM9/16/14
to vagra...@googlegroups.com
seems that is for the host?

I am sorry, can you send from the vagrant guest once you get a dhcp ip?


Jeff MacDonald

unread,
Sep 16, 2014, 7:54:30 PM9/16/14
to vagra...@googlegroups.com
SOrry about that. I was doing thigns too quickly and not paying attention.. I didn't ssh in.. silly me. Here we go..

eth0      Link encap:Ethernet  HWaddr 00:0C:29:E1:97:1D
          inet addr:172.16.81.194  Bcast:172.16.81.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee1:971d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:617 errors:0 dropped:0 overruns:0 frame:0
          TX packets:384 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:69885 (68.2 KiB)  TX bytes:57472 (56.1 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0C:29:E1:97:27
          inet addr:10.0.1.216  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee1:9727/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2817 (2.7 KiB)  TX bytes:1805 (1.7 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)




Jeff MacDonald

unread,
Oct 1, 2014, 4:04:26 PM10/1/14
to vagra...@googlegroups.com

The folks @vagrant got back to me. Its a bug with the provider. Or a feature not implemented yet.

Jeff.

Scott Carleton

unread,
Nov 5, 2014, 4:14:17 PM11/5/14
to vagra...@googlegroups.com
Jeff,

What was the bug?  Having a very similar situation.

Jeff MacDonald

unread,
Nov 6, 2014, 5:38:13 AM11/6/14
to vagra...@googlegroups.com
Just the fact that it won't work was the bug. Perhaps more like "a feature not yet implemented"

--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/1XZXcG4n_oc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Carleton

unread,
Nov 6, 2014, 12:21:43 PM11/6/14
to vagra...@googlegroups.com
Thanks.  Had started to suspect a bug within the core of VirtualBox

Jeff MacDonald

unread,
Nov 6, 2014, 12:26:05 PM11/6/14
to vagra...@googlegroups.com
Oh, it works fine in virtualbox. It only happens with teh vmware fusion provider.
Reply all
Reply to author
Forward
0 new messages