I wanted to use bridge controller in Kali-Linux 2, which would work out of the box in Backtrack and Kali-Linux 1.0. However, I am not able to find a solution for installing it on Kali-Linux 2.0
5 Answers
I'm Actually with MariusMatutiae moving away from ifconfig is the right way to go. The simple reason is that all the Linux distros are moving away from it. the more complex one can be found at ifconfig sucks.
Now let's simplify the creation of a bridge using the iproute2 Utility Suite:
ip link add name bridge_name type bridge
ip link set bridge_name up
Now to add devices you simply use:
ip link set int_name master bridge_name
The obvious example is:
ip link add name br0 type bridge
ip link set br0 up
ip link set eth0 master br0
ip link set eth1 master br0
It's the same amount of effort as in the bridge utils and might even be easier to remembering for some people, but that's just my opinion.
You should not use bridge-utils
any longer: the iproute2
will build a bridge for you, and it is installed by default.
Suppose you want to bridge eth0
and a tap0
interface, the following commands are needed:
ip tuntap add tap0 mode tap user root
ip link set tap0 up
ip link add br0 type bridge
ip link set tap0 master br0
ip link set dev eth0 down
ip addr flush dev eth0
ip link set dev eth0 up
ip lik set dev eth0 master br0
ip link set br0 up
This is a full series of commands, which creates the interface tap0
, clears eth0
from previous addresses (you never know...), enslaves both of them to br0
, and lastly brings up br0
, ready for
dhcp -v br0
If instead you want to give a static IP address to br0
, before bringing it up, just use:
ip addr add 192.168.1.63/24 dev br0
and then you can bring it up. It can easily be scripted, and inserted into /etc/network/interfaces
, just in case.
-
This seems more complicated. What is the reason that we should not use bridge-utils?– TotemCommented Jan 14, 2016 at 13:45
-
@Totem The brctl utility has been superseded by
ip
, which does everything, including creatingtun/tap
interfaces which could not be created by thebridge-utils
utility.brctrl
is still maintained but only to allow old production systems to continue working. As noticed by mango below, new Linux systems haveip
by default, notbrctrl
. Commented Jan 14, 2016 at 15:08
Use the following command to install them, they are not part of the standard install. Not strictly infosec, but you could be creating a virtual network for pen-testing.
apt-get install bridge-utils
-
2Thanks man! The above command was not working because it's source was not available in Kali 2.0– Y MCommented Sep 6, 2015 at 9:39
Since, the bridge utils package is not available by default,
apt-get install bridge-utils
won't work.
So start by adding to /etc/apt/sources.list
deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib
and then run:
apt-get update
apt-get install bridge-utils
-
Are they not the standard kali 2 repos? If not, don't add them, especially if they are kali 1 repos as you will cause conflictals all over the place. Besides bridge-utils is in the standard repos already I think. Commented Sep 6, 2015 at 9:40
-
1apt-get install bridge-utils works in kali 2 at time of writing this. No need to change any sources.– TotemCommented Jan 14, 2016 at 13:47
bridge-utils is still available in Kali Linux 2.0, but you have to add this to /var/apt/sources.list
deb http://security.kali.org/kali-security/ sana/updates main contrib non-free
deb-src http://security.kali.org/kali-security/ sana/updates main contrib non-free
After that run:
sudo apt-get update ## update the list of available packages
sudo apt-get install bridge-utils
bridge
from iproute2 instead?