f4gw

module
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2024 License: Apache-2.0

README

F4GW

Prerequisites

kernel >= v5.10

TOPO

Client[192.168.226.21] <--> F4GW[192.168.226.22, 192.168.127.22] <--> F4Proxy[192.168.127.31] <--> Internet

TEST

Client

curl http://httpbin.org -I

nslookup httpbin.org 8.8.8.8

ping 8.8.8.8

clear;tcpdump -i ens33 -en host 3.213.1.197

F4GW

system=$(uname -s | tr [:upper:] [:lower:])
arch=$(dpkg --print-architecture)
release=v0.4.1-alpha.1
curl -L https://github.com/cybwan/f4gw/releases/download/${release}/f4gw-${release}-${system}-${arch}.tar.gz | tar -vxzf -
cd ./${system}-${arch}

# modify gw.json
./f4gw -c gw.json

F4Proxy

system=$(uname -s | tr [:upper:] [:lower:])
arch=$(dpkg --print-architecture)
release=v0.4.1-alpha.1
curl -L https://github.com/cybwan/f4gw/releases/download/${release}/f4gw-${release}-${system}-${arch}.tar.gz | tar -vxzf -
cd ./${system}-${arch}

# modify proxy.json
./f4proxy -c proxy.json

# new terminal
pipy proxy.js

Tracing log (now disabled)

sudo cat /sys/kernel/debug/tracing/trace_pipe|grep bpf_trace_printk

nat netflow messages:

     ksoftirqd/0-14      [000] d.s21  7171.643922: bpf_trace_printk: ==================================
     ksoftirqd/0-14      [000] d.s21  7171.643949: bpf_trace_printk: f4m proto 17        ipv6(?) 0
     ksoftirqd/0-14      [000] d.s21  7171.643951: bpf_trace_printk: f4m daddr 8.8.8.8 dport 53
     ksoftirqd/0-14      [000] d.s21  7171.643953: bpf_trace_printk: f4m saddr 192.168.226.21 sport 39508
     ksoftirqd/0-14      [000] d.s21  7171.643953: bpf_trace_printk: f4m xaddr 192.168.127.22 xport 39508
          <idle>-0       [000] d.s31  7172.345965: bpf_trace_printk: ==================================
          <idle>-0       [000] dNs31  7172.345994: bpf_trace_printk: f4m proto 6         ipv6(?) 0
          <idle>-0       [000] dNs31  7172.345996: bpf_trace_printk: f4m daddr 18.208.239.112 dport 80
          <idle>-0       [000] dNs31  7172.345997: bpf_trace_printk: f4m saddr 192.168.226.21 sport 34706
          <idle>-0       [000] dNs31  7172.345997: bpf_trace_printk: f4m xaddr 192.168.127.22 xport 34706

Nat Netflow

bpftool map dump name f4gw_nat_opts

Directories

Path Synopsis
cmd
f4gw command
f4proxy command
test command
pkg
bpf
logger
Package logger implements utility routines to initialize the logging facility used by FSM components.
Package logger implements utility routines to initialize the logging facility used by FSM components.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL