Sunday, October 7, 2018

dummy2tuntap w/BASH --part II

###!!  For the rest of us normal vulnerable people with only one 
physical network adapter and public IP address on it::
 
sudo ip link set dummy0 up
sudo ip tuntap add dev TAP0 mode tun

 
=================================== 
To make the deployment faster I am using the below BASH scripts
 to create and destroy interfaces when needed
======================================= 
 nano dummy-bridge.sh
#!/bin/sh
/usr/sbin/tunctl -t tap0
/sbin/ifconfig tap0 0.0.0.0 promisc up
/sbin/ifconfig dummy0 0.0.0.0 promisc up
/sbin/brctl addbr br0
/sbin/brctl addif br0 tap0
/sbin/brctl addif br0 dummy0
/sbin/ifconfig br0 172.22.22.22/24 up
echo 1 > /proc/sys/net/ipv4/ip_forward
======================================= 
nano dummy-bridge-stop
#!/bin/sh
ifconfig br0 down
ifconfig dummy0 down
ifconfig tap0
brctl delif br0 tap0
brctl delif br0 dummy0
brctl delbr br0
tunctl -d tap0
tunctl -d tap1
tunctl -d tap2
tunctl -d tap3
======================================
 
 
 

No comments:

Post a Comment

Thank you for your comment. Will try to react as soon as possible.

Regards,

Networ King