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. Redis持久化——内存快照(RDB)

    最新:Redis持久化--如何选择合适的持久化方式 最新:Redis持久化--AOF日志 最新:Redis持久化--内存快照(RDB) 一文回顾Redis五大对象(数据类型) Redis对象--有序集 ...

  2. [2020年10月28日普级组]1405.小B浇花

    区 间 和 的 和 区间和的和 区间和的和 题目解析 就直接模拟,从最低的花的高度向最高的花的高度枚举,如果当循环变量的值到达了顶峰,但还有花的数量大于2的,就把循环上线加一(所以数组要开大些) Co ...

  3. Distributed | MapReduce

    最近终于抽出时间开始学习MIT 6.824,本文为我看MapReduce论文和做lab后的总结. [MapReduce英文论文] lab要用到go语言,这也是我第一次接触.可以参考go语言圣经学习基本 ...

  4. Jenkins 实现Gitlab事件自动触发Jenkins构建及钉钉消息推送

    实现Gitlab事件自动触发Jenkins构建及钉钉消息推送 实践环境 GitLab Community Edition 12.6.4 Jenkins 2.284 Post build task 1. ...

  5. Python简单实现杨辉三角

    n=input("请输入要打印的行数")n=int(n)for x in range(0,n+1): p=1 print(''.rjust(n-x),end="" ...

  6. BUAA_2021_SE_READING_#1

    项目 内容 这个作业属于哪个课程 2021春季软件工程(罗杰 任健) 这个作业的要求在哪里 个人阅读作业#1 我在这个课程的目标是 通过课程学习,完成第一个可以称之为"软件"的项目 ...

  7. SQLlite实现增删查改

    activity_main.xml文件: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android ...

  8. Data Mining UVA - 1591

      Dr. Tuple is working on the new data-mining application for Advanced Commercial Merchandise Inc. O ...

  9. 用html自己开发自己的串口TCP通讯调试软件

    今天给大家介绍一个通讯工具,可以自己写html页面,自己写Js脚本实现数据收发. 本程序在不断完善中,请大家不要喷,多多理解,有意见只管提. 系列文章 概述 串口基础功能 TCP客户端收发 参数篇 串 ...

  10. 安全高效跨平台的. NET 模板引擎 Fluid 使用文档

    Liquid 是一门开源的模板语言,由 Shopify 创造并用 Ruby 实现.它是 Shopify 主题的主要构成部分,并且被用于加载店铺系统的动态内容.它是一种安全的模板语言,对于非程序员的受众 ...