Jump to content
Hak5 Forums
Sign in to follow this  
parrotgeek1

Need help with non-NAT (layer 2) bridge

Recommended Posts

Sometimes I will need to use my Turtle as a "dumb" Ethernet adapter. But I can't directly access IPs on the ethernet port side, because the Turtle is doing NAT.

I tried to make this script to set up the bridge, but I lose all network connection on my computer when I run it, making it very hard to debug. What's wrong?

#!/bin/bash

clear

echo 'ssh will close soon'

cat << 'EOF' | SHELL=/bin/bash at now

sleep 5

/etc/init.d/sshd stop

r8152_mac=$(cat /proc/net/arp | grep ' br-lan$' | awk '{print $4}')

ifconfig br-lan down

ifconfig eth0 down

ifconfig eth1 down

brctl delif br-lan eth0

brctl delif br-lan eth1

brctl delbr br-lan

iptables -F

iptables -X

iptables -t nat -F

iptables -t nat -X

iptables -t mangle -F

iptables -t mangle -X

iptables -P INPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -P OUTPUT ACCEPT

macchanger -m "$r8152_mac" eth1

ifconfig eth0 0.0.0.0

ifconfig eth1 0.0.0.0

brctl addbr br_layer2

brctl addif br_layer2 eth0

brctl addif br_layer2 eth1

ifconfig br_layer2 up

EOF

sleep 99999

 

Edited by parrotgeek1

Share this post


Link to post
Share on other sites
TheLynx   
On 12/7/2016 at 2:33 AM, parrotgeek1 said:

Sometimes I will need to use my Turtle as a "dumb" Ethernet adapter. But I can't directly access IPs on the ethernet port side, because the Turtle is doing NAT.

I tried to make this script to set up the bridge, but I lose all network connection on my computer when I run it, making it very hard to debug. What's wrong?

Did you managed to find a working solution? I'm stuck with the same problem, I also have the problem that a have a use case where is need to use the Turtle as a dump Ethernet interface and also stuck.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×