Difference between revisions of "Bridge with netctl"

From ArchWiki
Jump to: navigation, search
(stuff moved to Network bridge)
(Configuration: Added an example of a statically configured bridge, usage of the single quotes for the value was not immediately obvious to me, a similar example i found online helped)
Line 23: Line 23:
 
</nowiki>}}
 
</nowiki>}}
  
 +
* This example creates a statically assigned bridge called {{ic|br0}} which has real Ethernet adapter {{ic|eth0}} connected to it. Edit {{ic|br0}}, {{ic|eth0}}, {{ic|Address}}, and {{ic|Gateway}} to your needs.
 +
{{hc| /etc/netctl/bridge|<nowiki>
 +
Description="Example Bridge connection"
 +
Interface=br0
 +
Connection=bridge
 +
BindsToInterfaces=(eth0)
 +
IP=static
 +
Address='192.168.10.20/24'
 +
Gateway='192.168.10.200'
 +
## Ignore (R)STP and immediately activate the bridge
 +
SkipForwardingDelay=yes
 +
</nowiki>}}
 
{{Tip|If you are using static IP, see man pages of [[netctl]], and also edit {{ic|/etc/resolv.conf}} if necessary.}}
 
{{Tip|If you are using static IP, see man pages of [[netctl]], and also edit {{ic|/etc/resolv.conf}} if necessary.}}
 +
  
 
* You can bridge any combination of network devices editing {{ic|BindsToInterfaces}} option.
 
* You can bridge any combination of network devices editing {{ic|BindsToInterfaces}} option.
 
* If any of the bridged devices (e.g. {{ic|eth0}}, {{ic|tap0}}) had [[dhcpcd]] enabled, [[systemd#Using units|stop and disable]] the {{ic|dhcpcd@eth0.service}} daemon. Or set {{ic|1=IP=no}} to the netctl profiles.
 
* If any of the bridged devices (e.g. {{ic|eth0}}, {{ic|tap0}}) had [[dhcpcd]] enabled, [[systemd#Using units|stop and disable]] the {{ic|dhcpcd@eth0.service}} daemon. Or set {{ic|1=IP=no}} to the netctl profiles.
 
* Finally, [[netctl#Just one profile|start and enable]] your {{ic|/etc/netctl/bridge}}.
 
* Finally, [[netctl#Just one profile|start and enable]] your {{ic|/etc/netctl/bridge}}.

Revision as of 04:01, 17 September 2014

Merge-arrows-2.pngThis article or section is a candidate for merging with Network bridge.Merge-arrows-2.png

Notes: I suggest to move the netctl-specific parts of this article into a subsection of "Network bridge" (Discuss in Talk:Bridge with netctl#)

Installation

Install the netctl package from the official repositories.

Configuration

  • Copy /etc/netctl/examples/bridge to /etc/netctl/bridge.
  • In this example, we create a bridge called br0 which has real Ethernet adapter eth0 and (optionally) a tap device tap0 connected to it. Of course, edit br0, eth0 and tap0 to your needs.
/etc/netctl/bridge
Description="Example Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0 tap0)
IP=dhcp
  • This example creates a statically assigned bridge called br0 which has real Ethernet adapter eth0 connected to it. Edit br0, eth0, Address, and Gateway to your needs.
 /etc/netctl/bridge
Description="Example Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=static
Address='192.168.10.20/24'
Gateway='192.168.10.200'
## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes
Tip: If you are using static IP, see man pages of netctl, and also edit /etc/resolv.conf if necessary.


  • You can bridge any combination of network devices editing BindsToInterfaces option.
  • If any of the bridged devices (e.g. eth0, tap0) had dhcpcd enabled, stop and disable the dhcpcd@eth0.service daemon. Or set IP=no to the netctl profiles.
  • Finally, start and enable your /etc/netctl/bridge.