64
router_class :: IPClassifier(dst host extern,dst host me, -);
//classify if the router packets are icmp
icmp_r_packet_classifier :: IPClassifier (icmp type echo,icmp type echo-reply, proto
icmp, -);
icmp_r2_packet_classifier :: IPClassifier (icmp type echo,icmp type echo-reply, proto
icmp, -);
//non-grid device
extern_dev :: GatewayDevice(eth0);
// ARP MACHINERY for non-grid device
arp_class :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
// ARP Querier
//arpq :: ARPQuerier(extern);
extern_dev -> arp_class;
arp_class[0] -> ARPResponder(extern) //respond to ARP queries
-> extern_dev;
//arp_class[1] -> [1]arpq;
arp_class [1] -> Discard;
//packets from output 2 are data packets (non-ARP). They are dealt with below.
arp_class[3] -> Discard; //discard unrecognized packets
// REWRITERS for NAT
IPRewriterPatterns(to_world_pat extern 50000-65535 - -,
to_intern_pat me 50000-65535 - -
);
rewriter :: IPRewriter(// internal traffic
pattern to_world_pat 0 1,
// external traffic
pattern to_intern_pat 1 0,
//pass through packets from internal
//to check for previous routes
pass 2,
//pass through packets from external
//to check for previous routes
pass 3
);
Comentarios a estos manuales