Frage: IpV6 FreeBSD / JAILS

AnimaTow

Member
Hallo ich versuche seit einiger zeit schon auf meinen Jails ipv6 zu nutzen,

nur leider scheine ich irgendwas nicht zu verstehen, oder fahlsch zu machen...
vielleicht kann mir einer ja helfen, oder ein tip geben...

meine BASE Freebsd 9.1 IPV6 geht in der Base 100%

hier mal meine Configs

RC.conf nur ipv6 einstellungen
Code:
ipv6_static_routes="ovhgw"
ipv6_route_ovhgw="2001:xxxx:1:57ff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ipv6_defaultrouter="2001:xxxx:1:57ff:ff:ff:ff:ff"
ipv6_activate_all_interfaces="YES"
ipv6_gateway_enable="YES"

ifconfig_em0_ipv6="inet6 2001:xxxx:1:5788::1 prefixlen 56"
ifconfig_em0_alias2="inet6 2001:xxxx:1:5788::2 prefixlen 56"


cloned_interfaces="lo1"
ifconfig_lo1="inet 10.10.10.253 netmask 255.255.255.0"
ifconfig_lo1_ipv6="inet6 fec0:0:0:5::253 prefixlen 64"
ifconfig_lo1_alias0="inet 10.10.10.1 netmask 255.255.255.0"
ifconfig_lo1_alias1="inet6 fec0:0:0:5::1 prefixlen 64"


pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""



PF.CONF
Code:
ext_if = "{ em0 }"
int_if = "{ lo1 }"
loop_if = "{ lo0 }"
pptp_if = "{ lo2 }"

ext_ipv6 = "{ 2001:xxxx:1:5788::1 }"
ext_ipv6_ns1 = "{ 2001:xxxx:1:5788::2 }"
ext_ipv6_web1_master = "{ 2001:xxxx:1:5788::20 }"

jail_web1_ipv4_lo0 = "{ 127.0.0.2 }"
jail_web1_ipv4_lo1 = "{ 10.10.10.1 }"
jail_web1_ipv6_lo1 = "{ fec0:0:0:5::1 }"

##########################
##### TABLES - A structure used to hold lists of IP addresses.
##########################
table <blocked_ip> persist file "/etc/pf.block.ip.conf"
table <allowed_vpnnetz> { 172.16.1.0/24 }
table <allowed_jails> { 10.10.10.0/24 }

### Skip all PF processing on specified interface. This can be useful on loopback interfaces where filtering, normalization, queueing, etc, are not required.
set skip on $loop_if

# Macht Statistiken (pfctl -s info)
set loginterface em0

##########################
##### NORMALIZATION
##########################
scrub in all

##########################
##### TRANSLATION
##########################

### NAT IPv6
nat on $ext_if inet6 proto {tcp udp icmp6 gre} from $jail_web1_ipv6_lo1 to any -> $ext_ipv6_web1_master

##########################
##### RDR
##########################
### [HTTP] Outside to DMZ
rdr on $ext_if inet proto tcp from any to $ext_ip port 80 -> $jail_web1_ipv4_lo1
rdr on $ext_if inet6 proto tcp from any to $ext_ipv6_web1_osupcom port 80 -> $jail_web1_ipv6_lo1

# Generelle Block Regel
block on $ext_if
block return log on $ext_if
block in quick on $ext_if from <blocked_ip> to any

##########################
##### PASS
##########################
### Loopback Device darf alles
pass quick on $loop_if

### Jail web1 ###
pass in quick on $ext_if inet proto tcp from any to $jail_web1_ipv4_lo1 port 80
pass in quick on $ext_if inet6 proto tcp from any to $jail_web1_ipv6_lo1 port 80


# OUT #
pass out quick on $ext_if inet proto tcp from any to any port ssh keep state queue ( ssh_out, ssh_ack_out )
pass out quick on $ext_if inet proto tcp all keep state queue ( std_out, ack_out )
pass out quick on $ext_if inet proto udp all keep state queue std_out

### IPv6 Out ###
pass out log on $ext_if inet6 proto {tcp, udp, icmp6, gre} all
pass in log on $ext_if inet6 proto {tcp, udp, icmp6, gre} all

### ICMP ###
pass in quick proto icmp6 all
#pass in quick proto icmp all

### PING ###
pass in on $ext_if inet proto icmp from $ping_outbound_ips to any icmp-type $icmp_types_in keep state
pass out on $ext_if inet proto icmp from $ping_outbound_ips to any icmp-type $icmp_types_out keep state
pass in on $ext_if inet6 proto icmp6 from $ping6_outbound_ips to any icmp6-type $icmp6_types_in keep state
pass out on $ext_if inet6 proto icmp6 from $ping6_outbound_ips to any icmp6-type $icmp6_types_out keep state
### TRACEROUTE ###
pass in on $ext_if inet proto udp from any to any port 33433 >< 33626 keep state
pass in on $ext_if inet6 proto udp from any to any port 33433 >< 33626 keep state


traceroute6 BASE
Code:
traceroute6 to ipv6.l.google.com (2a00:1450:400c:c00::93) from 2001:xxxx:1:5788::1, 64 hops max, 12 byte packets
 1  rbx-1-6k.fr.eu  0.846 ms *  0.677 ms
 2  rbx-g2-a9.fr.eu  1.057 ms  0.994 ms  0.916 ms
 3  gsw-g1-a9.fr.eu  5.092 ms  5.535 ms
    gsw-g1-a9.fr.eu  4.789 ms
 4  * * *
 5  google.as15169.fr.eu  5.570 ms  4.758 ms  4.982 ms
 6  2001:4860::1:0:4a3a  4.989 ms
    2001:4860::1:0:9f2  5.556 ms
    2001:4860::1:0:4a3a  5.418 ms
 7  2001:4860::8:0:3df5  5.916 ms
    2001:4860::8:0:3df4  6.093 ms
    2001:4860::8:0:3df5  5.974 ms
 8  2001:4860::8:0:507b  10.714 ms  10.266 ms
    2001:4860::8:0:507c  10.323 ms
 9  2001:4860::2:0:87b  10.586 ms  10.630 ms
    2001:4860::2:0:87d  25.408 ms

traceroute6 JAIL WEB1
Code:
traceroute6 to ipv6.l.google.com (2a00:1450:4007:806::1014) from fec0:0:0:5::1, 64 hops max, 12 byte packets
 1  rbx-1-6k.fr.eu  1.562 ms  11.127 ms *
 2  rbx-g2-a9.fr.eu  2.627 ms  1.792 ms  2.253 ms
 3  gsw-g1-a9.fr.eu  7.324 ms
    gsw-g1-a9.fr.eu  4.704 ms  4.684 ms
 4  * * *
 5  google.as15169.fr.eu  5.937 ms  4.797 ms  5.035 ms
 6  2001:4860::1:0:9f2  7.764 ms  4.846 ms  5.124 ms
 7  2001:4860:0:1::39f  5.118 ms  5.002 ms  5.208 ms
 8  * * *
 9  * * *


PING6 JAIL WEB1
Code:
root@web1:/root # ping6 google.com
PING6(56=40+8+8 bytes) fec0:0:0:5::1 --> 2a00:1450:4007:806::1001
16 bytes from 2a00:1450:4007:806::1001, icmp_seq=0 hlim=57 time=4.769 ms
16 bytes from 2a00:1450:4007:806::1001, icmp_seq=1 hlim=57 time=4.775 ms
16 bytes from 2a00:1450:4007:806::1001, icmp_seq=2 hlim=57 time=4.827 ms


WGET TEST JAIL WEB1
Code:
root@web1:/root # wget ipv6.google.com
--2013-08-31 12:19:45--  http://ipv6.google.com/
Resolving ipv6.google.com (ipv6.google.com)... 2a00:1450:4007:806::1014
Connecting to ipv6.google.com (ipv6.google.com)|2a00:1450:4007:806::1014|:80...

BASE
Code:
root@master:/root # nc -6uvw 1 2001:4860:4860::8888 53
Connection to 2001:4860:4860::8888 53 port [udp/domain] succeeded!
root@master:/root # nc -6vw 1 2001:4860:4860::8888 53
Connection to 2001:4860:4860::8888 53 port [tcp/domain] succeeded!

JAIL WEB1
Code:
root@web1:/root # nc -6uvw 1 2001:41d0:a:ddee:1::1 53
Connection to 2001:41d0:a:ddee:1::1 53 port [udp/domain] succeeded!
root@web1:/root # nc -6vw 1 2001:41d0:a:ddee:1::1 53
nc: connect to 2001:41d0:a:ddee:1::1 port 53 (tcp) failed: Operation timed out

was mach ich nur Falsch, bin schon etwas am verzweifeln....
 
Zuletzt bearbeitet:
TCM leider verstehe ich dich nicht was du genau meinst...


ok ich habe die ipv6 jetzt mal direkt eingebunden, jetzt scheint es zu gehen

Code:
Connection to 2001:4860:4860::8888 53 port [tcp/domain] succeeded!
root@web1:/root # nc -6uvw 1 2001:4860:4860::8888 53
Connection to 2001:4860:4860::8888 53 port [udp/domain] succeeded!

aber schade das ich das mit dem nat nicht hinbekomme sollte einer doch noch eine lösung kennen wäre ich sehr dankbar...
 
Zuletzt bearbeitet:
Hallo ich habe das noch weiter probiert..
aber problem besteht weiterhin..


tcpdump bei wget ipv6.google.com
Code:
00:20:45.218816 IP6 2001:41d0:1:5788::11.54243 > par03s12-in-x12.1e100.net.http: Flags [S], seq 3778281342, win 65535, options [mss 1440,nop,wscale 6,sackOK,TS val 3928168 ecr 0], length 0

pflog bei wget ipv6.google.com
Code:
all tcp 2001:41d0:1:5788::11[60618] (fec0:0:0:5::2[53370]) -> 2a00:1450:4007:805::1012[80]       SYN_SENT:CLOSED

kann einer damit was anfangen, und mir helfen ?
 
Zuletzt bearbeitet:
Zuerst mal würde ich ganz dringend aufhören, IPv6 zu NATen.

PS:
Code:
ipv6_route_ovhgw="2001:41D0:1:57ff:ff:ff:ff:ff -prefixlen 128 -interface em0"
ifconfig_em0_ipv6="inet6 2001:xxxx:1:5788::1 prefixlen 56

Viel anonymisiert hast du damit nicht. :)
 
Hi sag mir doch mal warum ich es nicht NATen soll ?

ich will ipv6 NETen da ich keine lust habe auf jeder jail noch eine extra firewall zu verwallten.. natürlich ist es so ohne probleme möglich ipv6 direkt in die jail zu linken..

aber ich würde das lieber alles über eine firewall einrichten und nicht über 14 firewalls !!

natürlich ist es recht einfach ne pf für die jails einzurichten.. aber wie ich schon gesagt habe 14 firewalls auf einem server finde ich schon etwas übel, 1x base 13 jails und das nur für ipv6

es muss doch auch möglich sein die ipv6 zu NETen, ich habe zwar momentan alles direkt eingebunden, wäre aber glücklicher mit dem NATen, und wenn es nicht möglich ist wäre es vieleicht Cool zu wissen warum es nicht so einfach möglich ist.. ein normaler Router kann das doch auch warum soll das nicht auch mein server können ?

Und PS:
TCM: du hast recht hatte ich übersehen, ist auch an sich egal obs anonymisiert ist..
und ich möchte dich echt bitten wenn du solche posts hier rein schreibst warum ich es nicht machen soll..
und zum Post 1 von dir der mich echt verwirt hatte
Nevermind, ich kommt mit rulesets ohne quick nicht klar

ich hatte einige kolegen gefragt ob die wissen was du damit gemein hast...

Zitat von d31m0
moment der hat "Nevermind, ich kommt mit rulesets ohne quick nicht klar" geschrieben?

ne schreib da nochmal rein das der post wieder oben ist. das war irgend nen depp
wenn der mit rulesets ohne quick nicht klar kommt, kommt der mit 98% aller firewalls nicht klar
 
Zuletzt bearbeitet:
*seufz* Ich hatte was geschrieben, was beim genauen Hinsehen doch nicht zutraf, weil du kein "quick" in den Regeln benutzt.

Fürs nächste Mal, bevor du einen Post sonstwohin schleppst und unqualifizierte Meinungen einsammelst: "Nevermind" heißt, dass man es nicht weiter beachten soll.

Was NAT jetzt damit zu tun hat, dass du ansonsten 14 Firewalls brauchst, versteh ich gleich schonmal gar nicht. Frag doch deine Profi-Kollegen, warum man IPv6 nicht NATet.
 
ipv6 hat per definition kein nat mehr aber das heisst nicht das man es nicht machen kann

und 14 firewalls darum da ich auf jeder jail eine firewall benötige wenn ich die ipv6 direkt ich die jail linkte.. den benötige ich eine firewall für jede jail für ipv6


extIF="em0"
ip6www="2001:dead:beaf::1"
block in on $extIF all
pass in log on $extIF inet6 proto tcp from any to $ip6www port 80


ich werde das jetzt hier auch Caten: ich werde erstmal meine jails nicht NATen...

aber sollte einer doch noch mal eine ordentliche antwort haben wäre ich sehr dankbar..
 
Zuletzt bearbeitet:
und 14 firewalls darum da ich auf jeder jail eine firewall benötige wenn ich die ipv6 direkt ich die jail linkte.. den benötige ich eine firewall für jede jail für ipv6

Warum? Du machst eine Firewall auf dem Basissystem und gut ist. Damit kannst du den kompletten Traffic zu und von den Jails kontrollieren.

Was mich auch wundert ist, warum du in der rc.conf ipv6_gateway_enable="YES" setzt. Der Host ist sicherlich kein Router, oder?

Rob
 
Zurück
Oben