OpenBSD router/firewall am NetCologne Anschluss

giantegg

Member
Hallo und guten Tag.
Ich bin vor kurzem umgezogen und habe deshalb meinen ISP von Unitymedia zu NetCologne (vom Regen in die Traufe) gewechselt. Von den versprochenden 50 mb/s kommen an guten Tagen vielleicht 25 mb/s an aber na gut was will man machen, hier gibt es nichts besseres.
Mit dem Anschlusswechsel kam zum Glück auch die Routerfreiheit also bin ich von meiner zwangs Router-Modem Krankheit auf ein draytek vigor130(nur modem, erfüllt laut netcologne alle Anforderungen) + apu2 mit openbsd umgestiegen. Die Lernkurve von linux zu openbsd war zwar da aber hielt sich dank der wirklich exzellenten Dokumentation in Grenzen.
Nun gibt es aber ein paar Probleme bei denen ich mir nicht sicher bin ob sie an meiner Fehlkonfiguration oder an NetCologne liegen.

Problem Nummer Eins:
Über VLAN10 baue ich eine pppoe Verbindung zu NetCologne auf, dass funktioniert auch (sowohl v4 als auch v6), jedoch bauen viele Webseiten gar nicht oder nur sehr langsam auf. Ich habe dann mal mit Wireshark drüber geguckt und mir sind viele TCP Retransmission, TCP ACKed Unseen segments usw. aufgefallen, was ja auf Paketverlust hindeutet. Ich glaub zwar nicht dass das an mir liegt sondern eher an NetCologne aber vielleicht führt ja ein Fehler in meiner pf.conf oder in einer anderen Konfigurationsdatei dazu.

Problem Nummer Zwei:
VOIP findet bei NetCologne über VLAN20 statt, die private IP kriegt man über DHCP (10.15.38.216 war es heute) jedoch sagt einem der DHCPServer von NetCologne auch das man bitte eine default route (0.0.0.0) für dieses Gateway setzen soll, was meines Erachtens überhaupt keinen Sinn macht dar erstens diese schon besteht(wurde ja für pppoe0 gesetzt) und zweitens hat das interface keinen Zugang zum Öffentlichen Internet da es sich ja nur um die Verbindung zum NetCologne SIP Server handelt. Ich hab dann aus Testzwecken eine statische Route für 172.17.66.118 (der NetCologne SIP Server) gesetzt, leider kein Erfolg, ich konnte den weder pingen, noch hat nmap darauf einen SIP server erkannt. Also Festnetz Telefon gibt es nicht.

Hat vielleicht jemand ähnliche Hardware an einem NetCologne Anschluss laufen oder hat sonst Irgend eine Idee. Ich Möchte nämlich nicht noch einmal vom Support gesagt bekommen das ich doch bitte den Router neustarten soll

ifconfig -a
Code:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
  index 5 priority 0 llprio 3
  groups: lo
  inet6 ::1 prefixlen 128
  inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
  inet 127.0.0.1 netmask 0xff000000
em0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
  lladdr 00:0d:b9:46:2b:38
  description: LAN wireless AP
  index 1 priority 0 llprio 3
  media: Ethernet autoselect (1000baseT full-duplex,master)
  status: active
em1: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
  lladdr 00:0d:b9:46:2b:39
  description: LAN upstairs
  index 2 priority 0 llprio 3
  media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
  status: active
em2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  lladdr 00:0d:b9:46:2b:3a
  description: WAN modem link
  index 3 priority 0 llprio 3
  media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
  status: active
enc0: flags=0<>
  index 4 priority 0 llprio 3
  groups: enc
  status: active
vether0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
  lladdr fe:e1:ba:d0:ec:d0
  index 6 priority 0 llprio 3
  groups: vether
  media: Ethernet autoselect
  status: active
  inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
  inet6 fe80::fce1:baff:fed0:ecd0%vether0 prefixlen 64 scopeid 0x6
  inet6 2001:4dd3:a267:1:fce1:baff:fed0:ecd0 prefixlen 64
vlan10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  lladdr 00:0d:b9:46:2b:3a
  description: WAN pppoe NET
  index 7 priority 0 llprio 3
  vlan: 10 parent interface: em2
  vnetid: 10
  parent: em2
  groups: vlan
  status: active
vlan20: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  lladdr 00:0d:b9:46:2b:3a
  description: WAN DHCP VOIP
  index 8 priority 0 llprio 3
  vlan: 20 parent interface: em2
  vnetid: 20
  parent: em2
  groups: vlan
  status: active
  inet 10.15.38.216 netmask 0xfffe0000 broadcast 10.15.255.255
pppoe0: flags=208851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST,AUTOCONF6> mtu 1440
  index 9 priority 0 llprio 3
  dev: vlan10 state: session
  sid: 0x1de1 PADI retries: 7 PADR retries: 0 time: 01:45:08
  sppp: phase network authproto pap
  groups: pppoe egress
  status: active
  inet6 fe80::20d:b9ff:fe46:2b38%pppoe0 ->  prefixlen 64 scopeid 0x9
  inet 87.79.183.40 --> 195.14.226.20 netmask 0xffffffff
  inet6 2001:4dd0:af14:5a92:20d:b9ff:fe46:2b38 ->  prefixlen 64 autoconf pltime 604797 vltime 2591997
  inet6 2001:4dd0:af14:5a92:241d:5a38:6734:439 ->  prefixlen 64 autoconf autoconfprivacy pltime 79654 vltime 598493
bridge0: flags=41<UP,RUNNING>
  index 10 llprio 3
  groups: bridge
  priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
  vether0 flags=3<LEARNING,DISCOVER>
  port 6 ifpriority 0 ifcost 0
  em0 flags=3<LEARNING,DISCOVER>
  port 1 ifpriority 0 ifcost 0
  em1 flags=3<LEARNING,DISCOVER>
  port 2 ifpriority 0 ifcost 0
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33144
  index 11 priority 0 llprio 3
  groups: pflog

route show
Code:
Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            bras-vc1.netcologn UGS        5    29178     -     8 pppoe0
base-address.mcast localhost          URS        0        0 32768     8 lo0 
10.14/15           10.15.38.216       UCn        0        0     -     4 vlan20
10.0.1/24          10.0.1.1           UCn        3       15     -     4 vether0
10.0.1.1           fe:e1:ba:d0:ec:d0  UHLl       0     2284     -     1 vether0
10.0.1.15          6c:3b:6b:76:fc:11  UHLc       0       51     -     3 vether0
10.0.1.29          00:0c:c1:02:17:2a  UHLc       0     2942     -     3 vether0
10.0.1.43          90:2b:34:57:eb:36  UHLc       3    22268     -     3 vether0
10.0.1.255         10.0.1.1           UHb        0        0     -     1 vether0
10.15.38.216       00:0d:b9:46:2b:3a  UHLl       0        0     -     1 vlan20
10.15.255.255      10.15.38.216       UHb        0        0     -     1 vlan20
xdsl-87-79-183-40. xdsl-87-79-183-40. UHl        0     1147     -     1 pppoe0
loopback           localhost          UGRS       0        0 32768     8 lo0 
localhost          localhost          UHhl       2      144 32768     1 lo0 
bras-vc1.netcologn xdsl-87-79-183-40. UHh        1        1     -     8 pppoe0

Internet6:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            fe80::%pppoe0      UGS        0    26864     -     8 pppoe0
default            fe80::561e:56ff:fe UG         0        0     -    56 pppoe0
::/96              localhost          UGRS       0        0 32768     8 lo0 
::/104             localhost          UGRS       0        0 32768     8 lo0 
localhost          localhost          UHhl      14       28 32768     1 lo0 
::127.0.0.0/104    localhost          UGRS       0        0 32768     8 lo0 
::224.0.0.0/100    localhost          UGRS       0        0 32768     8 lo0 
::255.0.0.0/104    localhost          UGRS       0        0 32768     8 lo0 
::ffff:0.0.0.0/96  localhost          UGRS       0        0 32768     8 lo0 
2001-4dd0-af14-5a9 2001-4dd0-af14-5a9 UHl        0        0     -     1 pppoe0
2001-4dd0-af14-5a9 2001-4dd0-af14-5a9 UHl        0      818     -     1 pppoe0
2001-4dd3-a267-1-0 2001-4dd3-a267-1-f UCn        2        0     -     4 vether0
2001-4dd3-a267-1-0 2001-4dd3-a267-1-f UC         0        0     -    56 vether0
2001-4dd3-a267-1-7 90:2b:34:57:eb:36  UHLc       0    28821     -     3 vether0
2001-4dd3-a267-1-b 00:0c:c1:02:17:2a  UHLc       0     7747     -     3 vether0
2001-4dd3-a267-1-f fe:e1:ba:d0:ec:d0  UHLl       0      345     -     1 vether0
2002::/24          localhost          UGRS       0        0 32768     8 lo0 
2002:7f00::/24     localhost          UGRS       0        0 32768     8 lo0 
2002:e000::/20     localhost          UGRS       0        0 32768     8 lo0 
2002:ff00::/24     localhost          UGRS       0        0 32768     8 lo0 
fe80::/10          localhost          UGRS       0       14 32768     8 lo0 
fec0::/10          localhost          UGRS       0        0 32768     8 lo0 
fe80::1%lo0        fe80::1%lo0        UHl        0        0 32768     1 lo0 
fe80::%vether0/64  fe80::fce1:baff:fe UCn        3        3     -     4 vether0
fe80::20c:c1ff:fe0 00:0c:c1:02:17:2a  UHLc       0      407     -     3 vether0
fe80::556:6f86:358 90:2b:34:57:eb:36  UHLc       0      966     -     3 vether0
fe80::7ef9:eff:fef 7c:f9:0e:fd:cf:2d  UHLc       0        4     -     3 vether0
fe80::fce1:baff:fe fe:e1:ba:d0:ec:d0  UHLl       0      196     -     1 vether0
fe80::%pppoe0/64   fe80::20d:b9ff:fe4 Uhn        2        9     -     4 pppoe0
fe80::20d:b9ff:fe4 fe80::20d:b9ff:fe4 UHl        0        2     -     1 pppoe0
fe80::561e:56ff:fe pppoe0             UHL        0      714     -     4 pppoe0
ff01::/16          localhost          UGRS       0        2 32768     8 lo0 
ff01::%lo0/32      localhost          Um         0        1 32768     4 lo0 
ff01::%vether0/32  fe80::fce1:baff:fe Um         0        1     -     4 vether0
ff01::%pppoe0/32   fe80::20d:b9ff:fe4 Um         0        2     -     4 pppoe0
ff02::/16          localhost          UGRS       0        2 32768     8 lo0 
ff02::%lo0/32      localhost          Um         0        1 32768     4 lo0 
ff02::%vether0/32  fe80::fce1:baff:fe Um         0       13     -     4 vether0
ff02::%pppoe0/32   fe80::20d:b9ff:fe4 Um         1       10     -     4 pppoe0

pf.conf
Code:
int_if="{ vether0 em0 em1 }"
ext_if="pppoe0"
sip_if="vlan20"

table <martians> {
        0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16     \
        172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 224.0.0.0/3 \
        192.168.0.0/16 198.18.0.0/15 198.51.100.0/24        \
        203.0.113.0/24 ::/128 ::1/128 ::ffff:0:0/96 ::/96   \
        100::/64 2001:10::/28 2001:db8::/32 fc00::/7        \
        fec0::/10
}

priority_queue_udp = "{ 27000:27030, 7000:7999, 64738 }"

set block-policy drop
set loginterface $ext_if
set skip on lo

# priority queues
pass on $ext_if set prio (3, 4)
match on $ext_if proto udp from any port $priority_queue_udp to any set prio 6

# set VLAN priority to 6 according to https://www.onlinekosten.de/forum/showthread.php?t=133352
match on $sip_if set prio 6

match in all scrub (random-id max-mss 1440)
match out on $ext_if inet from !($ext_if:network) to any nat-to ($ext_if:0)

block log all
block in log quick on $ext_if from <martians> to any
block return out log quick on $ext_if from any to <martians>

pass out quick inet
pass out quick inet6
pass in on $int_if inet
pass in on $int_if inet6

# ICMP for IPv4
pass inet proto icmp all icmp-type echoreq

# ICMP for IPv6
pass quick inet6 proto icmp6 icmp6-type { unreach, toobig, echoreq, echorep, neighbradv, neighbrsol routeradv, routersol }
pass quick inet6 proto icmp6 icmp6-type timex code transit
pass quick inet6 proto icmp6 icmp6-type timex code reassemb
pass quick inet6 proto icmp6 icmp6-type paramprob code badhead
pass quick inet6 proto icmp6 icmp6-type paramprob code nxthdr
pass quick inet6 proto icmp6 icmp6-type paramprob code 2

# dhcp6c
pass in quick on $ext_if inet6 proto udp from any to port 546

Vielen Dank für die Hilfe!
 
Du hast 10/8 in deiner <martians>-Tabelle und blockierst dich somit selbst.
Erstmal würde ich mit deaktiviertem pf arbeiten, bis rein technisch alles funktioniert.

Rob
block in log quick on $ext_if from <martians> to any blockt aber nur falls diese aus irgend einem grund von außen kommen sollten, also sollte das nicht das problem sein.
Du hast 10/8 in deiner <martians>-Tabelle und blockierst dich somit selbst.
Erstmal würde ich mit deaktiviertem pf arbeiten, bis rein technisch alles funktioniert.

Rob

aber ich blockiere doch nur auf $ext_if und der voip server sitzt hinter $sip_if.

Das könnte an der MTU liegen, wie ist die auf dem Modem konfiguriert?

Rob

MTU guck ich grade aber ich glaube nicht das darin der Fehler liegt da nicht alle Verbindungen das Problem haben
 
änder die scrub regel von "in" auf jeglichen traffic, damit auch der ausgehende traffic mit der entsprechenden Segment Size gesendet wird. Bei mir war das ausschlaggebend, iirc.

Für die zusätzliche default route, könntest du das entsprechende vlan Interface in eine eigene rdomain packen, die auch eine eigene Routing Tabelle hat. Allerdings müssen dann sämtliche Dienste, die das verwenden, auch in der rdomain gestartet werden, per pair interface mit der rdomain 0 verbunden werden oder pf muss den traffic schubsen.
 
hi

da ich auch bei nc bin , hallo netznachbar ;)

mtu ist zu klein 1496 sollte gesetzt sein.

das thema sip nach 172.17.66.118 bekommst du nur viia sipp proxy sauber hin , da nc die verbindugsdaten im udp / sip packet verwendet und nicht die verbindungsdaten die genatet sind.

abei meine sipproxy.connf
hier musste du deine localen netze und interfaces entsürechend anpassend.

if_inbound = pair3
if_outbound = pppoe0

hosts_allow_reg = 192.168.132.0/24,172.16.0.0/24,172.17.66.0/24
hosts_allow_sip = 192.168.132.0/24,172.16.0.0/24,172.17.66.0/24



sip_listen_port = 5060


daemonize = 1

silence_log = 1

user = _siproxd
chrootjail = /var/siproxd/


registration_file = siproxd_registrations

autosave_registrations = 300

pid_file = siproxd.pid

rtp_proxy_enable = 1

rtp_port_low = 7070
rtp_port_high = 7089

rtp_timeout = 300

rtp_dscp = 46

sip_dscp = 0

rtp_input_dejitter = 0
rtp_output_dejitter = 0

tcp_timeout = 600
tcp_connect_timeout = 500
tcp_keepalive = 20


debug_level = -1

debug_port = 0


ua_string = sip.netcologne.de





plugindir=/usr/local/lib/siproxd/
load_plugin=plugin_logcall.so
load_plugin=plugin_fix_fbox_anoncall.so


plugin_demo_string = This_is_a_string_passed_to_the_demo_plugin


plugin_shortdial_akey = *00
plugin_shortdial_entry = 17474743246
plugin_shortdial_entry = 17474745000

plugin_defaulttarget_log = 1
plugin_defaulttarget_target = sip:internal@dddd:port

plugin_fix_bogus_via_networks = 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

plugin_fix_DTAG_networks = 217.0.23.100/32

plugin_stun_server = stun.stunprotocol.org
plugin_stun_port = 3478
plugin_stun_period = 300

plugin_prefix_akey = 0

plugin_regex_desc = Test Regex 1
plugin_regex_pattern = ^(sips?:)00
plugin_regex_replace = \1+

plugin_regex_desc = Test Regex 2
plugin_regex_pattern = ^(sips?:)01
plugin_regex_replace = \1+a

plugin_regex_desc = Test Regex 3
plugin_regex_pattern = ^(sips?:)01
plugin_regex_replace = \1:001

plugin_stripheader_remove = Allow
plugin_stripheader_remove = User-Agent
plugin_stripheader_remove = Supported:100rel

plugin_codecfilter_blacklist = G722
plugin_codecfilter_blacklist = G726
plugin_codecfilter_blacklist = G729
plugin_codecfilter_blacklist = GSM


plugin_fix_fbox_anoncall_networks = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/20

beachte bei den host_allow zeilen das das sip netz von netcologne enthalten sein muss.

der daemon verbindet sich mit dem sip server und nimmt auch die verbindungen von dort entgegen,
somit musst du via pf nur ein allow in/out auf dem pppoe if beibringen , kein NAT !


holger
 
Vielen Dank für die Antworten erstmal, der Tip von mapet hat funktioniert alle Verbindungen funktionieren jetzt. Jedoch bin ich was VOIP anbetrifft sehr verwirrt. Auf der Netcologne website steht ja das die VOIP verbindung über vlan20 läuft (worauf ich ja über DHCP auch ne IP krieg) aber mark05 macht das Ganze über einen siproxy ? Ich verstehe nicht ganze wie der sip proxy über pppoe0 (was ja das Öffentliche Internet ist) zu 172.16.0.0/24 (was ja eine private IP ist) routen kann. Hilf mir bitte mal weiter, SIP und VOIP sind nicht gerade mein Fachgebiet.
 
hi
172.17. ist eine fach ein netz welches nur netcologne kunden erreichen koennne von anschluss seite her.

kann mann machen.

ich selber habe kein vlan 10/020 woran dan liegt kann ich nicht sagen ggf ist das dsl art abhengig.
ich habe vdsl 100 .

holger
 
hat vieleicht irgenwer ne Ahnung wie ich die Verbindung zum Netcologne SIP Server aufbauen kann? Bin ein bisschen ratlos.
 
Kleines Update. Das mit den rdomains scheint zu funktionieren, sieht so aus als würde asterisk sich erfolgreich am netcologne sip trunk registrieren.
 
Zurück
Oben