LSV Posted October 6, 2006 Posted October 6, 2006 (edited) Как заставить работать PPPoE через мост? топология такая... ppoe-server<-switch-> bridge <-> client2 ................| ................V .............client1 client1 без проблем работает с pppoe, сервис видится, у клиента2 сервис pppoe не видится В правилах фаервола есть 00003 0 0 allow gre from any to any 00004 131 11004 allow icmp from any to any 00005 58 3216 allow ip from any to any via lo0 ....бла бла бла... 65533 452 78174 deny log logamount 1000 ip from any to any В секюрити логе нет криминала относящегося к GRE и PPPoE PADI. Мост работает, клиент2 получает адрес по dhcp от сервера стоящего по другую сторону моста. вот такой дамп с интерфейса моста смотрящего в сторону клиента2, попытке подключиться клиентом2, на интерфейсе того же моста смотрящего в сторону pppoe сервера нет ничего относящегося к PPPOE 00:08:51.159285 IP 192.168.1.254.1032 > 192.168.1.4.22: . ack 1404 win 65535 00:08:51.963581 IP 192.168.1.4.22 > 192.168.1.254.1032: P 1404:1616(212) ack 1 win 65535 00:08:52.144125 IP 192.168.1.254.1032 > 192.168.1.4.22: . ack 1616 win 65323 00:08:52.492069 PPPoE PADI [Service-Name "*"] [Host-Uniq 0x525350450000000060CD13CE80E8C601] 00:08:52.966499 IP 192.168.1.4.22 > 192.168.1.254.1032: P 1616:1828(212) ack 1 win 65535 00:08:53.077709 IP 192.168.1.4.22 > 192.168.1.254.1032: P 1828:1960(132) ack 1 win 65535 00:08:53.078014 IP 192.168.1.254.1032 > 192.168.1.4.22: . ack 1960 win 64979 00:08:53.487204 PPPoE PADI [Service-Name "*"] [Host-Uniq 0x525350450000000060CD13CE80E8C601] 00:08:54.080531 IP 192.168.1.4.22 > 192.168.1.254.1032: P 1960:2092(132) ack 1 win 65535 00:08:54.082402 IP 192.168.1.4.22 > 192.168.1.254.1032: P 2092:2304(212) ack 1 win 65535 00:08:54.082873 IP 192.168.1.254.1032 > 192.168.1.4.22: . ack 2304 win 64635 Edited October 6, 2006 by LSV Вставить ник Quote
jab Posted October 6, 2006 Posted October 6, 2006 Проблема скорее всего вот в этом: В правилах фаервола есть 00003 0 0 allow gre from any to any 00004 131 11004 allow icmp from any to any 00005 58 3216 allow ip from any to any via lo0 ....бла бла бла... 65533 452 78174 deny log logamount 1000 ip from any to any Ну и в прокладке. Вставить ник Quote
LSV Posted October 7, 2006 Author Posted October 7, 2006 (edited) Хм, ну вот полные парвила... # ipfw show 00004 515 43360 allow icmp from any to any 00005 184 9936 allow ip from any to any via lo0 00200 7950 582366 allow ip from 192.168.1.0/24 to me via fxp0 00210 7962 2589698 allow ip from me to 192.168.1.0/24 via fxp0 00900 0 0 allow udp from 0.0.0.0 2054 to 0.0.0.0 00951 3209 531218 allow udp from any 67,68,137,138 to any via fxp2 00960 0 0 allow ip from any to 192.168.1.0/24 dst-port 20,21,22,25,43,47,53,80,110,123,443,465,995,1025-65535 out xmit fxp2 00970 20 1836 allow ip from 192.168.1.0/24 20,21,22,25,43,47,53,80,110,123,443,465,995,1025-65535 to any in recv fxp2 01000 9242 1525356 allow ip from any to any via fxp0 01601 6723 1101651 allow ip from any to any via bridge1 02000 0 0 allow gre from any to any 65533 460 79458 deny log logamount 1000 ip from any to any 65535 6 348 deny ip from any to any Или нужно направленно делать? В таком случае что нужно направлять ибо при таких правилах... 0900 allow udp from 0.0.0.0 2054 to 0.0.0.0 1000 allow tcp from any to any in via fxp2 established 1200 allow tcp from any to any domain in via fxp2 1300 allow udp from any to any domain in via fxp2 1400 allow udp from any domain to any 1024-65535 in via fxp2 1500 allow tcp from any to any www in via fxp2 1600 allow icmp from any to any 1700 allow ip from any to any via fxp1 PPPoE тоже не работал, хм... Edited October 7, 2006 by LSV Вставить ник Quote
jab Posted October 7, 2006 Posted October 7, 2006 Я тоже всегда полагал что думать вредно. Вставить ник Quote
Барий Posted October 7, 2006 Posted October 7, 2006 Вы путаете кое-что с пальцем... PPPoE - это протокол канального (layer-2) уровня, ipfw - это фаервол только для протоколов IP-"семейства" (вообще название "ipfw" говорит само за себя). Для всех остальных протоколов - это не фаервол. man 8 ipfw: ..... A fwd rule will not match layer-2 packets (those received on ether_input, ether_output, or bridged). ..... net.link.ether.ipfw: 0 Controls whether layer-2 packets are passed to ipfw. Default is no. net.link.ether.bridge_ipfw: 0 Controls whether bridged packets are passed to ipfw. Default is no. Вставить ник Quote
Барий Posted October 7, 2006 Posted October 7, 2006 PS: Под FreeBSD есть и PPPoE и DHCP релеи. Вставить ник Quote
LSV Posted October 7, 2006 Author Posted October 7, 2006 Это я знаю, он мост рабоатет:) Почему PPPoE не работает? В таком случае возможно ли сделать PPPoE на фильтрующем мосту? Можно ли сделать пару мостов на одной машине- один фильтрующийся, другой -нет? переменные поставил так: net.inet.ip.fw.one_pass=0 net.link.ether.ipfw=1 net.link.ether.bridge_ipfw=1 net.link.ether.bridge.enable=1 всё равно не ходит Вставить ник Quote
LSV Posted October 9, 2006 Author Posted October 9, 2006 На этот раз ядро пересобрал... #options BRIDGE options DEVICE_POLLING #options IPDIVERT options IPFIREWALL options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=30 #options IPFIREWALL_FORWARD #options DUMMYNET options TCP_DROP_SYNFIN device loop # Network loopback device random # Entropy device device ether # Ethernet support #device sl # Kernel SLIP #device ppp # Kernel PPP #device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) #device md # Memory "disks" device gif # IPv6 and IPv4 tunneling #device faith # IPv6-to-IPv4 relaying (translation) device vlan device if_bridge Переменные: gatetwo# sysctl net.inet.ip net.inet.ip.portrange.lowfirst: 1023 net.inet.ip.portrange.lowlast: 600 net.inet.ip.portrange.first: 49152 net.inet.ip.portrange.last: 65535 net.inet.ip.portrange.hifirst: 49152 net.inet.ip.portrange.hilast: 65535 net.inet.ip.portrange.reservedhigh: 1023 net.inet.ip.portrange.reservedlow: 0 net.inet.ip.portrange.randomized: 1 net.inet.ip.portrange.randomcps: 10 net.inet.ip.portrange.randomtime: 45 net.inet.ip.forwarding: 0 net.inet.ip.redirect: 0 net.inet.ip.ttl: 128 net.inet.ip.rtexpire: 3600 net.inet.ip.rtminexpire: 10 net.inet.ip.rtmaxcache: 128 net.inet.ip.sourceroute: 0 net.inet.ip.intr_queue_maxlen: 50 net.inet.ip.intr_queue_drops: 0 net.inet.ip.accept_sourceroute: 0 net.inet.ip.keepfaith: 0 net.inet.ip.gifttl: 30 net.inet.ip.subnets_are_local: 0 net.inet.ip.same_prefix_carp_only: 0 net.inet.ip.fastforwarding: 0 net.inet.ip.fw.enable: 1 net.inet.ip.fw.autoinc_step: 100 net.inet.ip.fw.one_pass: 1 net.inet.ip.fw.debug: 1 net.inet.ip.fw.verbose: 1 net.inet.ip.fw.verbose_limit: 30 net.inet.ip.fw.dyn_buckets: 256 net.inet.ip.fw.curr_dyn_buckets: 256 net.inet.ip.fw.dyn_count: 0 net.inet.ip.fw.dyn_max: 4096 net.inet.ip.fw.static_count: 15 net.inet.ip.fw.dyn_ack_lifetime: 300 net.inet.ip.fw.dyn_syn_lifetime: 20 net.inet.ip.fw.dyn_fin_lifetime: 1 net.inet.ip.fw.dyn_rst_lifetime: 1 net.inet.ip.fw.dyn_udp_lifetime: 10 net.inet.ip.fw.dyn_short_lifetime: 5 net.inet.ip.fw.dyn_keepalive: 1 net.inet.ip.process_options: 1 net.inet.ip.sendsourcequench: 0 net.inet.ip.random_id: 0 net.inet.ip.check_interface: 0 net.inet.ip.fragpackets: 0 net.inet.ip.maxfragsperpacket: 16 net.inet.ip.maxfragpackets: 96 gatetwo# sysctl net.link net.link.generic.system.ifcount: 7 net.link.ether.inet.prune_intvl: 300 net.link.ether.inet.max_age: 600 net.link.ether.inet.maxtries: 5 net.link.ether.inet.useloopback: 1 net.link.ether.inet.proxyall: 0 net.link.ether.inet.log_arp_wrong_iface: 1 net.link.ether.inet.log_arp_movements: 1 net.link.ether.inet.log_arp_permanent_modify: 1 net.link.ether.ipfw: 0 net.link.bridge.pfil_onlyip: 1 net.link.bridge.pfil_bridge: 1 net.link.bridge.pfil_member: 1 net.link.bridge.ipfw: 0 net.link.gif.max_nesting: 1 net.link.gif.parallel_tunnels: 0 net.link.log_link_state_change: 1 Где копать? Почему PPPoE через мост не ходит? сделал так: sysctl net.link.bridge.pfil_onlyip=0 Заработал PPPoE через мост. Теперь задача в том чтобы через один мост разрешить PPPoE, а на другой не разришать, как это сделать? Вставить ник Quote
LSV Posted October 10, 2006 Author Posted October 10, 2006 (edited) сделал так: sysctl net.link.bridge.pfil_onlyip=0 Заработал PPPoE через мост. Теперь задача в том чтобы через один мост разрешить PPPoE, а на другой не разришать, как это сделать? 2 моста на одной машине man if_bridge: net.link.bridge.ipfw Set to 1 to enable layer2 filtering with ipfirewall(4), set to 0 to disable it. This needs to be enabled for dummynet(4) support. When ipfw is enabled, pfil_bridge and pfil_member will be disabled so that IPFW is not run twice; these can be re-enabled if desired. Как фильтровать протоколы L2, кроме MAC? А вот так: PACKET FLOW A packet is checked against the active ruleset in multiple places in the protocol stack, under control of several sysctl variables. These places and variables are shown below, and it is important to have this picture in mind in order to design a correct ruleset. ^ to upper layers V ^ to upper layers V | | +----------->-----------+ ^ V [ip(6)_input] [ip(6)_output] net.inet.ip.fw.enable=1 [ip(6)_input] [ip(6)_output] net.inet.ip.fw.enable=1 | | ^ V [ether_demux] [ether_output_frame] net.link.ether.ipfw=1 | | +-->--[bdg_forward]-->--+ net.link.ether.bridge_ipfw=1 ^ V | to devices | ................................................................................ .............. # packets from ether_demux or bdg_forward ipfw add 10 skipto 1000 all from any to any layer2 in # packets from ip_input ipfw add 10 skipto 2000 all from any to any not layer2 in # packets from ip_output ipfw add 10 skipto 3000 all from any to any not layer2 out # packets from ether_output_frame ipfw add 10 skipto 4000 all from any to any layer2 out есть есть кто это уже разруливал попросил бы поделиться парвилами, а пока сам ковыряться буду, потом выложу что получитя... to jab болт, сам прокладку меняй! Edited October 10, 2006 by LSV Вставить ник Quote
snark Posted June 28, 2008 Posted June 28, 2008 Как заставить работать PPPoE через мост?необходимо разрешить layer2 0x8863 и 0x8864 P.S. понимаю что поздно, но вдруг кто поиском набредет :) Вставить ник Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.