What have I neglected to do in order to get networking in a jail?

Arthur Chance freebsd at qeng-ho.org
Thu May 31 13:51:27 UTC 2018


On 31/05/2018 14:15, James B. Byrne via freebsd-questions wrote:
> On Thu, May 31, 2018 04:55, Herbert J. Skuhra wrote:
>> On Wed, 30 May 2018 17:24:03 +0200, "James B. Byrne via
> 
>>> root at mx31:~ # ifconfig
>>> vtnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST>
>>> metric 0 mtu 1500
>>>         options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
>>>         ether 58:9c:fc:0e:cd:bb
>>>         hwaddr 58:9c:fc:0e:cd:bb
>>>         inet 218.185.71.31 netmask 0xffffffff broadcast 218.185.71.31
>>>
>>> Why does this jail not have a network connection?
>>
>> After a quick check I guess you are missing NAT on the host (pf or
>> ipfw)?
> 
> One does not require NAT when one has a public IP address assigned to
> the I/F.   The jail network traffic is not getting off the host system
> as I have determined from tcpdump.
> 
> I have set jails up before on a similarly configured host and have
> gotten them to work, albeit always with some difficulty or other.
> 
> 

I've just taken another look at your original mail. I think the key
might be in this

> [root at host:~]# jls
>    JID  IP Address      Hostname                      Path
>      1  127.0.31.1      mx31                          /usr/jails/mx31

Note address ^^^^^

>
> root at mx31:~ # ifconfig
> vtnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST>
> metric 0 mtu 1500
> 	options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
> 	ether 58:9c:fc:0e:cd:bb
> 	hwaddr 58:9c:fc:0e:cd:bb
> 	inet 218.185.71.31 netmask 0xffffffff broadcast 218.185.71.31
> 	inet 192.168.216.31 netmask 0xffffffff broadcast 192.168.216.31
> 	media: Ethernet 10Gbase-T <full-duplex>
> 	status: active
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> 	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
> 	groups: lo
> lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> 	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
> 	inet 127.0.31.1 netmask 0xffffffff
> 	groups: lo
> lo2: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
> 	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
> 	groups: lo

Whatever you think is happening this shows your jail is using a loopback
address on a loopback socket. Packets sent from loopback devices or from
loopback addresses are simply not going to get off the box.

-- 
An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).


More information about the freebsd-questions mailing list