Ubuntu 16.04 Bridge配置

一、安装网桥拓展包 bridge-utils

root@ubuntu:~# apt-get install bridge-utils

二、创建网桥设备

  //安装网桥拓展包会安装 brctl 命令,使用该命令创建网桥设备
root@ubuntu:~# brctl addbr br1 # br1是网桥设备名,类似网卡名称;也可以创建多个网桥设备 //可以在 /proc/sys/net/ipv4/conf/ 目录下查看创建的和已经存在的网卡设备文件
root@ubuntu:~# ls /proc/sys/net/ipv4/conf/
all br0 default eth0 eth1 eth2 eth3 eth4 lo # br0 就是刚刚创建的网桥名称

三、配置 bridge-utils

root@ubuntu:~# vim /etc/network/interfaces
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files! auto lo
iface lo inet loopback auto eth0
iface eth0 inet manual auto eth1
iface eth1 inet manual auto eth2
iface wth2 inet manual auto eth3
iface eth3 inet manual auto br0
iface br0 inet static
address 192.168.121.24
netmask 255.255.255.0
gateway 211.91.165.129
bridge_ports eth0
bridge_stp off
bridge_fd 0 auto br1
iface br1 inet manual
bridge_ports eth1
bridge_stp off
bridge_fd 0 auto br2
iface br2 inet manual
bridge_ports eth2
bridge_stp off
bridge_fd 0 auto br3
iface br3 inet manual
bridge_ports eth3
bridge_stp off
bridge_fd 0
  • 也可以配置动态(dhcp)
auto lo
iface lo inet loopback auto eth0
iface eth0 inet manual auto eth1
iface eth1 inet manual auto eth2
iface wth2 inet manual auto eth3
iface eth3 inet manual auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_ports eth1
bridge_ports eth2
bridge_ports eth3
bridge_stp off
bridge_fd 0

四、开启路由转发

  //网桥设置好后,需要设置路由转发功能
root@ubuntu:~# /etc/sysctl.conf
......
net.ipv4.ip_forward=1 # 添加或者去掉注释这一行
...... //让转发路由生效
root@ubuntu:~# sysctl -p

五、重启网络服务

root@ubuntu:~#  systemctl restart networking.service

Ubuntu 16.04 Bridge配置的更多相关文章

  1. Ubuntu 16.04修改配置静态IP和DNS

    Ubuntu 16.04修改配置静态IP和DNS 1.修改interfaces 文件 sudo gedit /etc/network/interfaces 2.添加 例如: auto enp0s25 ...

  2. [eShopOnContainers 学习系列] - 03 - 在远程 Ubuntu 16.04 上配置开发环境

    直接把 md 粘出来了,博客园的富文本编辑器换成 markdown,没啥效果呀 ,先凑合吧.实在不行换地方   # 在远程 Ubuntu 16.04 上配置开发环境 ## 零.因 为什么要用这么麻烦的 ...

  3. 【转】Ubuntu 16.04安装配置TensorFlow GPU版本

    之前摸爬滚打总是各种坑,今天参考这篇文章终于解决了,甚是鸡冻\(≧▽≦)/,电脑不知道怎么的,安装不了16.04,就安装15.10再升级到16.04 requirements: Ubuntu 16.0 ...

  4. Ubuntu 16.04 LTS 配置 Jupyter notebook 为服务器

    原材料: Ubuntu 16.04 LTS 64bit 已经配置好 IPython 和 Jupyter (安装步骤可以参照:http://www.cnblogs.com/McKean/p/619497 ...

  5. Ubuntu 16.04下配置 Nginx 与 Node.js 以及服务的部署

    第一步:安装nginx sudo apt-get update sudo apt-get install nginx 如果遇到依赖问题,尝试执行sudo apt-get -f install命令 第二 ...

  6. VMware 15安装Ubuntu 16.04并配置环境

    VMware(虚拟机)是指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统,它能在Windows系统上虚拟出多个计算机,每个虚拟计算机可以独立运行,可安装各种软件与应用等 ...

  7. Ubuntu 16.04 orb-slam2配置

    说明:Ubuntu 16.04以及必要的基础软件安装完成之后进行: 1.OpenNI2安装(可选) 安装依赖项: sudo apt--dev freeglut3-dev doxygen graphvi ...

  8. Ubuntu 16.04简单配置备忘录

    1.几个安装包的地址 1.Linux QQ:https://im.qq.com/linuxqq/index.html 2.网易云音乐:http://s1.music.126.net/download/ ...

  9. Ubuntu 16.04 安装配置支持http2的nginx

    第一步 安装最新版本的nginx 对于ubuntu16.04而言 直接装就是最新的 ``` sudo apt-get update sudo apt-get install nginx 查看Nginx ...

随机推荐

  1. 以聊天的形式解决traefik2.1.X的一个问题

    海口-老男人 17:24:48 大哥,这个是啥报错呀 海口-老男人 17:27:04 E0413 09:23:13.134144 1 reflector.go:153] pkg/mod/k8s.io/ ...

  2. 扩展中国剩余定理(EXCRT)学习笔记

    扩展中国剩余定理(EXCRT)学习笔记 用途 求解同余方程组 \(\begin{cases}x\equiv c_{1}\left( mod\ m_{1}\right) \\ x\equiv c_{2} ...

  3. 18. vue-router案例-tabBar导航

    目标: 做一个导航tabbar 一. 分析 我们的目标是做一个导航tabbar, 要求 这个导航不仅可以在一个页面使用, 可以在多个页面通用 每个页面的样式可能不一样 每个页面的图标, 文字可能不一样 ...

  4. JavaWeb 补充(Filter&Listener)

    目录 Filter:过滤器 Listener:监听器 Filter:过滤器 1. 概念:     * 生活中的过滤器:净水器,空气净化器,土匪.     * web中的过滤器:当访问服务器的资源时,过 ...

  5. element UI el-autocomplete 带输入建议的输入框

    项目需求:需要用户在输入框中输入公司 全名    但是为了避免用户输入不全   需要做一个带输入建议的输入框 参考:https://www.jianshu.com/p/de922caf337c

  6. git推送代码报错:fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream

    情景再现 远程新建仓库,然后本地 git bash执行以下代码 git init git add . git commit -m 'xxx' git remote add origin https:/ ...

  7. [重要更新]微信小程序登录、用户信息相关接口调整:使用 wx.getUserProfile 取代 wx.getUserInfo

    2021年2月24日,微信官方团队发布了一个调整通知:<小程序登录.用户信息相关接口调整说明>,公告明确从4月13日起,所有发布的小程序将无法使用 wx.getUserInfo 接口(JS ...

  8. 1144 The Missing Number

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  9. VScode+Sublime安装与汉化

    两大常用编辑器安装与汉化 想敲代码?工欲善其事,必先利其器,先安装编写代码所需要的工具吧.本期的主角是VScode与Sublime,这是两款比较热门的代码编辑器. 目录: VScode安装与汉化 Su ...

  10. 基于Docker配置本地Gitlab

    技术背景 Github和Gitee(码云)是最常见的基于git的代码托管平台,现在基于svn的代码管理仓库已经相对比较少见了,大部分还都是企业内部的代码仓.但是基于开源的Gitlab,我们在企业内网也 ...