라우터의 Shorewall은 가상 게스트에 대한 apt-get 업데이트를 계속 차단합니다.

라우터의 Shorewall은 가상 게스트에 대한 apt-get 업데이트를 계속 차단합니다.

이중 IP가 있습니다.LXC세 명의 사용자를 위해 구성된 권한 없는 여러 컨테이너가 있는 서버입니다. 각 사용자는 자체 브리지( lxcbr0, lxcbr1및 ) 를 갖습니다 lxcbr2. 효율성을 위해 호스트는 apt-cacher-ng이를 사용하도록 구성됩니다.cat /etc/apt/apt.conf.d/31apt-cacher-ng

Acquire::http { Proxy "http://217.8.191.52:3142"; };

네트워크 설정

Shorewall이 시작되면 호스트는 apt-get update다음과 같은 오류를 생성합니다.

Err http://security.ubuntu.com trusty-security/universe amd64 Packages
  500  Connection failure: Network is unreachable
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/restricted/binary-amd64/Packages  500  Connection failure: Connection refused

내가 삭제할 때/etc/apt/apt.conf.d/31apt-cacher-ng 또는안벽( sudo shorewall clear본체의) 청소가 apt-get update작동합니다.

rulesinclude 에서 많은 규칙을 시도했지만 ACCEPT all all아무것도 변경되지 않았습니다. 내 Shorewall 구성은 다음과 같습니다.

상호 작용:

net eth1 detect routefilter,dhcp,routeback,tcpflags,blacklist,nosmurfs,dhcp
- loopback detect ignore
lxc lxcbr0 detect bridge,routeback,dhcp
lxc lxcbr1 detect bridge,routeback,dhcp
lxc lxcbr2 detect bridge,routeback,dhcp

영역:

fw  firewall
lxc ip
net ip

사향:

eth1 10.0.0.0/16

정책:

$FW all ACCEPT - - -
lxc all ACCEPT - - -
net all DROP - - -

규칙(모든 호스트 이름이 있음 /etc/hosts):

SECTION NEW
DNAT all lxc:apaczek:22 tcp 1300
DNAT all lxc:hostA:22 tcp 1223
DNAT all lxc:hostB:22 tcp 1221
DNAT all lxc:hostC:22 tcp 1222
SSH(ACCEPT) all $FW
Ping(ACCEPT) all $FW
DNAT all lxc:hostA:22 tcp 22 - 217.8.191.53
ACCEPT lxc $FW tcp 3142 #To allow access to apt-cacher-ng

/etc/shorewall/shorewall.conf:

###############################################################################
#
#  Shorewall Version 4 -- /etc/shorewall/shorewall.conf
#
#  For information about the settings in this file, type "man shorewall.conf"
#
#  Manpage also online at http://www.shorewall.net/manpages/shorewall.conf.html
###############################################################################
#              S T A R T U P   E N A B L E D
###############################################################################

STARTUP_ENABLED=Yes

###############################################################################
#                     V E R B O S I T Y
###############################################################################

VERBOSITY=1

###############################################################################
#                       L O G G I N G
###############################################################################

BLACKLIST_LOGLEVEL=

LOG_MARTIANS=Yes

LOG_VERBOSITY=2

LOGALLNEW=

LOGFILE=/var/log/messages

LOGFORMAT="Shorewall:%s:%s:"

LOGTAGONLY=No

LOGLIMIT=

MACLIST_LOG_LEVEL=info

SFILTER_LOG_LEVEL=info

SMURF_LOG_LEVEL=info

STARTUP_LOG=/var/log/shorewall-init.log

TCP_FLAGS_LOG_LEVEL=info

###############################################################################
#   L O C A T I O N   O F   F I L E S   A N D   D I R E C T O R I E S
###############################################################################

CONFIG_PATH="/etc/shorewall/puppet:/etc/shorewall:/usr/share/shorewall"

IPTABLES=

IP=

IPSET=

MODULESDIR=

PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin"

PERL=/usr/bin/perl

RESTOREFILE=restore

SHOREWALL_SHELL=/bin/sh

SUBSYSLOCK=""

TC=

###############################################################################
#       D E F A U L T   A C T I O N S / M A C R O S
###############################################################################

ACCEPT_DEFAULT=none
DROP_DEFAULT=Drop
NFQUEUE_DEFAULT=none
QUEUE_DEFAULT=none
REJECT_DEFAULT=Reject

###############################################################################
#                        R S H / R C P  C O M M A N D S
###############################################################################

RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
RSH_COMMAND='ssh ${root}@${system} ${command}'

###############################################################################
#           F I R E W A L L   O P T I O N S
###############################################################################

ACCOUNTING=Yes

ACCOUNTING_TABLE=filter

ADD_IP_ALIASES=No

ADD_SNAT_ALIASES=No

ADMINISABSENTMINDED=Yes

AUTO_COMMENT=Yes

AUTOMAKE=No

BLACKLISTNEWONLY=Yes

CLAMPMSS=No

CLEAR_TC=Yes

COMPLETE=No

DELETE_THEN_ADD=Yes

DETECT_DNAT_IPADDRS=No

DISABLE_IPV6=No

DONT_LOAD=

DYNAMIC_BLACKLIST=Yes

EXPAND_POLICIES=Yes

EXPORTMODULES=Yes

FASTACCEPT=No

FORWARD_CLEAR_MARK=

IMPLICIT_CONTINUE=No

IP_FORWARDING=On

KEEP_RT_TABLES=No

LEGACY_FASTSTART=Yes

LOAD_HELPERS_ONLY=No

MACLIST_TABLE=filter

MACLIST_TTL=

MANGLE_ENABLED=Yes

MAPOLDACTIONS=No

MARK_IN_FORWARD_CHAIN=No

MODULE_SUFFIX=ko

MULTICAST=No

MUTEX_TIMEOUT=60

NULL_ROUTE_RFC1918=No

OPTIMIZE=0

OPTIMIZE_ACCOUNTING=No

REQUIRE_INTERFACE=No

RESTORE_DEFAULT_ROUTE=Yes

RETAIN_ALIASES=No

ROUTE_FILTER=Yes

SAVE_IPSETS=No

TC_ENABLED=Internal

TC_EXPERT=No

TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"

TRACK_PROVIDERS=No

USE_DEFAULT_RT=No

ZONE2ZONE=2

###############################################################################
#           P A C K E T   D I S P O S I T I O N
###############################################################################

BLACKLIST_DISPOSITION=DROP

MACLIST_DISPOSITION=REJECT

SMURF_DISPOSITION=DROP

SFILTER_DISPOSITION=DROP

TCP_FLAGS_DISPOSITION=DROP

################################################################################
#           P A C K E T  M A R K  L A Y O U T
################################################################################

TC_BITS=

PROVIDER_BITS=

PROVIDER_OFFSET=

MASK_BITS=

ZONE_BITS=0

################################################################################
#                            L E G A C Y  O P T I O N
#                      D O  N O T  D E L E T E  O R  A L T E R
################################################################################

IPSECFILE=zones

관련 정보