Date Tags triage

Quick and dirty way to configure a wireless router(Airport Express), to use your linux pc as a network gateway. I needed to sniff the network of some wireless devices, which can be quite handy.

You'll need to do a few things:
1.) Enable IP Forwarding
2.) Configure iptables to nat/forward traffic from in one interface and out another
3.) Bridge the device, and use dhcpd to handle dhcp for the devices(Much easier to track)

Enable IP Forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Configure iptables(as root):

#Interface you are sending traffic out(eth0)  
#Going out usb-ethernet  
iptables --table nat --append POSTROUTING --out-interface eth0 -j
#Going out my wireless  
iptables --table nat --append POSTROUTING --out-interface wlp8s0 -j

#Interface you are forwarding traffic from(Airport hooked to this
iptables --append FORWARD --in-interface enp7s0 -j ACCEPT

Configure dhcpd4 to hand out dhcpcd on enp7s0

#Replace xxx IP with valid dns servers.  
[jmorgan@arch-dopey ~]$ cat /etc/dhcpd.conf  
option domain-name "";  
option domain-name-servers,;  
default-lease-time 14440;  
ddns-update-style none;  
deny bootp; shared-network airport {  
subnet netmask {  
option routers;  
option subnet-mask;  
pool { range; }  
#start dhcpd4  
[jmorgan@arch-dopey ~]$ sudo systemctl start dhcpd4

Launch wireshark, and watch traffic from the interface you are forwarding from(enp7s0 for me).


By Jacob Morgan

Share on: Twitter * Facebook * Google+ * Email


comments powered by Disqus