Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to assign an IP to bridged interfaces? For example, under normal circumstances:

ifconfig eth0
ifconfig eth1
brctl addbr mybridge
brctl addif mybridge eth0
brctl addif mybridge eth1

So is there a way to either:

  • (a) assign IPs to eth0/eth1?
  • (b) if not, then is there any other way around this problem?

I want to some how bridge interfaces having IPs.

share|improve this question

migrated from stackoverflow.com Mar 3 '13 at 16:37

This question came from our site for professional and enthusiast programmers.

You can directly assign a new IP address to your bridge:

ip addr add brd + dev br0

You also may need to configure a route for the internet connection:

route add default gw dev br0

Note: replace the provided IP address in the above examples by the proper one for your subnet.

share|improve this answer

An interface that is a member of a bridge cannot have IPs assigned to it directly. You assign an address to the bridge interface instead, e.g.

ifconfig br0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.