Iocage: freebsd 12, vnet configuration, no connectivity to gateway, can ping host with iocage installed

Created on 16 Dec 2018  路  6Comments  路  Source: iocage/iocage

I doubt that there is something really wrong with iocage, but rather something is missing in documentation. I would be really thankful if someone could help me out...

  • [ ] Supply iocage --version
    Version 0.9.10 2017/12/22

  • [ ] Supply the commands used, along with any steps to recreate it.
    Followed: https://iocage.readthedocs.io/en/latest/networking.html

  • [ ] Provide the output from the command you issued.
    ping, telnet, ...

  • [ ] Supply what you expected the result or output to be
    Connection to internet available

  • [ ] Checked that the problem has not already been fixed on master if using
    a stable release.
    I think there is something missing in documentation.

question

All 6 comments

In jail ping -S jail_ip gateway doesnt work and returns ping: bind: Can't assign requested address

# rc.conf:
cloned_interfaces="bridge1"
ifconfig_bridge1="addm re0 up"
# sysctl.conf:
net.inet.ip.forwarding=1       # Enable IP forwarding between interfaces
net.link.bridge.pfil_onlyip=0  # Only pass IP packets when pfil is enabled
net.link.bridge.pfil_bridge=0  # Packet filter on the bridge interface
net.link.bridge.pfil_member=0  # Packet filter on the member interface

config.json

"defaultrouter": "192.168.1.1",
"interfaces": "vnet1:bridge1",
"ip4_addr": "vnet1|192.168.1.21/24",
root@jail ~# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
        inet 127.0.0.1 netmask 0xff000000 
        groups: lo 
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
pflog0: flags=0<> metric 0 mtu 33160
        groups: pflog 
vnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 02:ff:60:fe:cb:1c
        hwaddr 02:78:9d:1f:bd:0b
        inet6 fe80::ff:60ff:fefe:cb1c%vnet1 prefixlen 64 scopeid 0x3 
        inet 192.168.1.21 netmask 0xffffff00 broadcast 192.168.1.255 
        groups: epair 
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@host ~# ifconfig
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
        ether 52:54:00:3f:6d:5e
        inet 192.168.1.20 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
pflog0: flags=0<> metric 0 mtu 33160
        groups: pflog
bridge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:66:ae:67:0e:01
        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: vnet1:1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 5 priority 128 path cost 2000
        member: re0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 200000
        groups: bridge 
        nd6 options=9<PERFORMNUD,IFDISABLED>
vnet1:1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        description: associated with jail: www
        options=8<VLAN_MTU>
        ether 02:ff:60:fe:cb:1b
        hwaddr 02:78:9d:1f:bd:0a
        inet6 fe80::ff:60ff:fefe:cb1b%vnet1:1 prefixlen 64 scopeid 0x5 
        groups: epair 
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

In order for ping, sockstat and such to work you will need to set allow_raw_sockets=1

In order for ping, sockstat and such to work you will need to set allow_raw_sockets=1

I havent included it into question, but i have raw sockets turned on. And also tried telneting which is not ICMP, the connectivity really doesnt work. But thank you for trying to help anyway...

Try swapping everything to vnet0, there may be some old code paths in 0.9.10 that do not like vnet1 as the first interface.

@roker can you print the ARP table of the jail and grep the hosts one for 192.168.1.21?

I am sorry for late reply, didnt have time to test it but following the skarekrow advice, it now works. I changed bridge name from bridge1 to bridge0 and vnet1 to vnet0 and now it works.

Thank you very much for help.

Was this page helpful?
0 / 5 - 0 ratings