How actually disable/remove default network interface in Vagrant?

Hai All
I’m very new in Vagrant. I’ve question, how actually i can remove default network interface in vagrant. I just want to use bridge network, but default network interface in vagrant is very annoying to me, how to remove default interface network and routing in vagramt
this is my ip addr result:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 02:60:6a:4c:cc:dc brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 86223sec preferred_lft 86223sec
    inet6 fe80::60:6aff:fe4c:ccdc/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:f1:3e:7a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.15/24 brd 192.168.1.255 scope global dynamic enp0s8
       valid_lft 86226sec preferred_lft 86226sec
    inet6 fe80::a00:27ff:fef1:3e7a/64 scope link 
       valid_lft forever preferred_lft forever

This is my default route in vagrant:

$ ip route list
default via 10.0.2.2 dev enp0s3 proto dhcp src 10.0.2.15 metric 100 
default via 192.168.1.1 dev enp0s8 proto dhcp src 192.168.1.15 metric 100 
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15 
10.0.2.2 dev enp0s3 proto dhcp scope link src 10.0.2.15 metric 100 
192.168.1.0/24 dev enp0s8 proto kernel scope link src 192.168.1.15 
192.168.1.1 dev enp0s8 proto dhcp scope link src 192.168.1.15 metric 100 

the vm has got ip address from dhcp but it can’t/won’t ping my other komputer in LAN neither ping router 192.168.1.1.
if I give ip address for public_network in Vagrantfile is always connection refused, if i try to shutdown default interface vagrant in this case enp0s3 has IP address 10.0.2.15 the vagrant vm is hang, yes i know because vagrant ssh connected and login via enp0s3.
enp0s3 can ping google.com. but can’t ping my LAN. if i remove default route from network interface enp0s3. I can’t ping google.com. so what actually the function of bridge networking in vagrant?
and how to remove network interface enp0s3 from my vm vagrant?

Thank in Advance
Afiadi

1 Like

This question too, I have problem with use ipv4 default in Ansible

It seems to me that you’re using virtualbox, if I’m not mistaken. I don’t think you can really, because vagrant needs to initially connect to the virtual machine over SSH for provisioning, if I remember correctly. So it needs to have an existing network interface for that.