FreeBSD - 监狱内没有互联网连接

FreeBSD - 监狱内没有互联网连接

我目前正在尝试在 FreeBSD 上设置服务器。我想根据 ezjails 创建监狱手册。我按照示例在监狱内安装 BIND,但我陷入了安装步骤 ( make -C /usr/ports/dns/bind99 install clean)。

起初我以为我遇到了 DNS 问题(不好/etc/resolv.conf),但看起来我在监狱内根本没有互联网。

在主机上:(8.8.178.110是www.freebsd.org)

root@varda:~ # nc -z -w 2 8.8.178.110 80
Connection to 8.8.178.110 80 port [tcp/http] succeeded!

监狱内:

root@dns:~ # nc -z -w 2 8.8.178.110 80; echo $?
1

知道发生了什么事吗?


root@varda:~ # ezjail-admin list
STA JID  IP              Hostname                       Root Directory
--- ---- --------------- ------------------------------ ------------------------
DR  2    192.168.4.1     www                            /home/jails/www
    2    lo1|127.0.1.1
DR  3    192.168.3.1     dns                            /home/jails/dns
    3    lo2|127.0.2.1

www是另一个监狱,我也有同样的问题)


root@varda:~ # ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
    ether 00:22:4d:ad:be:2a
    inet ???.???.???.??? netmask 0xffffff00 broadcast ???.???.???.??? 
    inet6 fe80::222:4dff:fead:be2a%em0 prefixlen 64 scopeid 0x1 
    inet6 2001:41d0:a:f231::1 prefixlen 128 
    inet 192.168.4.1 netmask 0xffffffff broadcast 192.168.4.1 
    inet 192.168.3.1 netmask 0xffffffff broadcast 192.168.3.1 
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
    inet 127.0.0.1 netmask 0xff000000 
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet 127.0.1.1 netmask 0xffffffff 
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo2: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet 127.0.2.1 netmask 0xffffffff 
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

root@dns:~ # ifconfig
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
 options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
    ether 00:22:4d:ad:be:2a
    inet 192.168.3.1 netmask 0xffffffff broadcast 192.168.3.1 
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
lo2: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet 127.0.2.1 netmask 0xffffffff

答案1

你需要resolv.conf/path/to/jails/etc/resolv.conf

这是我在开始之前实际放入监狱的完整列表。

相关内容