1

so the issue is that i am using hetzner for my server hosting and they suck at making any working tutorial. i have purchased a /29 subnet block.

136.243.229.24 / 29 - subnet
136.243.6.76 - main server ip

How do i configure a bridge on the host server (centos) so that the guests (ubuntu) can use the subnet ips?

centos eth0 file

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=0C:C4:7A:0C:95:4E
IPADDR=136.243.6.76
NETMASK=255.255.255.255
SCOPE="peer 136.243.6.65"
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6INIT=yes
IPV6ADDR=2a01:4f8:211:1fcb::2/64
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0

what should the config look like to add the bridge and route the subnet?

i have tried there wiki http://wiki.hetzner.de/index.php/Netzkonfiguration_CentOS/en but this is a useless guide.

1 Answer 1

1
# ip link add name bridge_name type bridge
# ip link set bridge_name up

# ip link set eth0 master bridge_name

This is using the now standard way of managing IP's and links using the iproute2 tool.

To remove a link and delete the bride do:

# ip link set eth0 nomaster
# ip link delete bridge_name type bridge

The old way to do it but isn't obsolete in any way is via bridge-utils:

# brctl addbr bridge_name
# brctl addif bridge_name eth0

But I fail to see why you would need bridge utils these days.

Also almost every distro these days have poor documentation, but one distro that does upstream documentation really well is the Arch Linux Wiki, it's rare that they fail to have a good updated wiki that is applicable on most other distros. There might be path issues because for instance Debian or Debian based distros have odd naming conventions, but those are easy fixes and well in this case it's only commands that you need to run and those are the same.

But why bridges?

I completely understand why you would need a bridge. But if your VM does not require direct Internet access I would strongly recommend using tap interfaces and on the host machine and do ip forwarding and some iptable rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.