Solved Dedicate server - bhyve, if_bridge and four real IP

OS FreeBSD 11.1-Release Dedicate server

ipfw if off
pf is off

all traffic open

internet access is ON on HOST machine and work fine
bhyve work is fine, guest systems boot and wait internet )))

Check please my configuration...
Code:
# ifconfig igb0
igb0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
        ether 00:25:11:e6:98:76
        hwaddr 00:25:11:e6:98:76
        inet 194.57.114.45 netmask 0xffffff00 broadcast 194.57.114.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)


Code:
# ifconfig bridge0 create
# ifconfig tap0 create
# ifconfig brdige0 addm igbd0 addm tap0 up

One more
Code:
# ifconfig bridge0 up
# ifconfig tap0 up

But four IP-Adresses from another subnet
If add alias on the igb0 interface, IP-Adresses working fine, but me needed work under guest VM.
193.125.91.75/24 - i can use only four ip from pull ...75 - ...78
193.125.91.1 gateway

I try on the guest machine FreeBSD 11.1-Release too, doing this steps...

Code:
# ifconfig vtnet0 193.125.91.75 netmask 255.255.255.0
# route add default 193.125.91.1
# ifconfig vtnet0 up
# ping 8.8.8.8
all packets loss ((((

What i must do on the guest machine, for have real ip on the guest machine ?

What wrong ?
Help, please...
 
Anybody knows, why bridge doesn't work with real IP's ? :(
Or i have errors in configuration ?

Tell please...
 
Yes, of course...

HOST
Code:
# ifconfig igb0
igb0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
       options=2400b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6>
        ether 00:25:11:e6:98:76
        hwaddr 00:25:11:e6:98:76
        inet 194.57.114.45 netmask 0xffffff00 broadcast 194.57.114.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)

Code:
# ifconfig tap1
tap1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80000<LINKSTATE>
        ether 00:bd:c9:58:07:01
        hwaddr 00:bd:c9:58:07:01
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
        groups: tap
        Opened by PID 6515

Code:
# ifconfig bridge0
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:c9:3f:87:1a:00
        nd6 options=9<PERFORMNUD,IFDISABLED>
        groups: bridge
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: igb0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 200000
        member: tap1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 8 priority 128 path cost 2000000


GUEST machine


Code:
# ifconfig vtnet0
vtnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 00:a0:98:2c:af:59
        inet 193.125.91.75 netmask 0xffffff00 broadcast 193.125.91.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 10Gbase-T <full-duplex>
        status: active

Code:
# route add default 193.125.91.1
 
may be this is importand
bridge variables set

Code:
# sysctl -a | grep net.link.bridge
net.link.bridge.ipfw: 0
net.link.bridge.allow_llz_overlap: 0
net.link.bridge.inherit_mac: 0
net.link.bridge.log_stp: 0
net.link.bridge.pfil_local_phys: 0
net.link.bridge.pfil_member: 0
net.link.bridge.ipfw_arp: 0
net.link.bridge.pfil_bridge: 0
net.link.bridge.pfil_onlyip: 1
 
on guest ping host machine 194.57.114.45

Code:
# ping 194.57.114.45
PING 194.57.114.45 (194.57.114.45): 56 data bytes

and nothing... :(
 
for test, bridge work or no and config correct or not
if i use local adresses 192.168.1.0/24
all work fine, ping is ok host, guest and comuters in local network...

BUT
when i setup real IP's, not working... ((((
 
my thoughts:
have you enabled the host as a gateway within rc.conf?

The only other thing i can think of atm is that, it's trying to exit via 193.125.91.1 but doesn't know how to reach that gateway.

If you try:
On host
Code:
sysrc gateway_enable="YES"

then configure sysctl:
net.inet.ip.forwarding = 1

On VM
Code:
ifconfig vtnet0 193.125.91.75 netmask 255.255.255.0
route add default your_host_ip
ifconfig vtnet0 up

then issue:
Code:
service netif restart
service routing restart

does that work?
 
Solved.
if_bridge work if fine.
Network bridge is not working, because filtering mac and ip adresses on the hosting provider.

thanks for all, who answer me :);)
 
Back
Top