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. E. 【例题5】平铺方案

    E . [ 例 题 5 ] 平 铺 方 案 E. [例题5]平铺方案 E.[例题5]平铺方案 解析 由于最近赶进度,解析写的就很简略 通过推算得出递推式 a [ i ] = a [ i − 1 ] + ...

  2. 不想eject,还咋修改create-react-app的配置?

    一.先抛问题 许多刚开始接触create-react-app框架的同学,不免都会有个疑问:如何在不执行eject操作的同时,修改create-react-app的配置.今天胡哥就来带大家一起来看看这个 ...

  3. BUAA_OO_第四单元

    一.UML解析器设计 ​ 先看下题目:第四单元实现一个基于JDK 8带有效性检查的UML(Unified Modeling Language)类图,顺序图,状态图分析器 MyUmlInteractio ...

  4. PAT B1030/A1085 完美数列

    给一个整数数列和正整数p,设这个数列中最大值M,最小值m,如果有M<=m*p,则称这个数列为完美数列,给一个p和一些正整数,从里面选择尽可能多的数,使他们构成一个完美数列,并输出最多可以选择的数 ...

  5. 前端框架之争丨除了Vue、Angular和React还有谁与之争锋

    转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者. 原文参考:https://www.sitepoint.com/most-popular-frontend-f ...

  6. 字符串转成KB,MB, GB

    import java.text.DecimalFormat; public class SizeUtil { public static String GetImageSize(String ima ...

  7. 【MybatisPlus】使用Wrappers条件构造器构造or和and

    模糊查询中,会有针对一个数据,需要查询数据库的多个字段的情况,例如: 上图中的平台名称和平台进程在数据表中是两个不同的字段, 如果不使用Mybatisplus,仅使用Mybatis,则只有通过写xml ...

  8. hdu4848 DFS 暴搜+ 强剪枝

    题意:       给你一个图,然后问你从1出发遍历所有的点的距离和是多少,这里的距离和是每一个点到1的距离的总和,不是选择一条遍历所有点的路径的总长度,时间限制是 8000ms. 思路:       ...

  9. Python中pip安装报错Unable to create process using '....'

    因为我本人在电脑上安装了python2和python3,所以在安装的时候,把两个python的安装目录都安装到G盘了.然后两个python的执行文件分别改成了 python2.exe 和  pytho ...

  10. Python模块化编程

    目录 模块化 自定义模块 模块的内置属性 导入模块 安装第三方模块 查看模块的属性和方法 模块化 在Python中,一个.py文件就称之为一个模块(Module),为了避免模块名冲突,Python又引 ...