AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 648132
Accepted
xinthose
xinthose
Asked: 2014-12-01 18:25:11 +0800 CST2014-12-01 18:25:11 +0800 CST 2014-12-01 18:25:11 +0800 CST

Debian Bridge 网络连接——静态 IP 地址

  • 772

我有一台带有 3 个以太网端口的 PC。我可以通过 eth1 上的 Internet 与其他两个端口共享 Internet。在 aptitude bridge-utils 和 brctl addbr br0 之后,我在 /etc/network/interfaces 上使用以下设置

auto lo br0
 iface lo inet loopback

 iface eth1 inet manual
 iface eth2 inet manual
 iface eth3 inet manual

 iface br0 inet dhcp
        bridge_ports eth1 eth2 eth3

但现在我想给一切静态IP地址

iface br0 inet static
        bridge_ports eth1 eth2 eth3
        address   192.168.10.200
        broadcast 192.168.10.255
        gateway   192.168.10.1
        netmask   255.255.255.0

 iface eth2 inet static
        address   192.168.10.201
        broadcast 192.168.10.255
        gateway   192.168.10.1
        netmask   255.255.255.0

 iface eth3 inet static
        address   192.168.10.202
        broadcast 192.168.10.255
        gateway   192.168.10.1
        netmask   255.255.255.0

我也可以给 eth1 一个静态 IP 地址吗?这就是以太网出现的地方。远程桌面连接时,我连接到 br0 的 IP 地址。但是,此配置无法让我访问 Internet。我不应该保留 iface eth1,2,3 inet 手册行,对吗?

networking
  • 1 1 个回答
  • 1030 Views

1 个回答

  • Voted
  1. Best Answer
    xinthose
    2014-12-02T09:55:47+08:002014-12-02T09:55:47+08:00

    源代码

    对于 eth2 上的 PLC,(eth1 是传入的互联网连接)确保它有一个静态 IP 地址设置,如

      address   10.0.0.3
      netmask   255.255.255.0
      gateway   10.0.0.1
    

    现在我可以在 RSLinx 上使用它了;这仍然没有给我静态 IP 地址,但是如果你在设备本身上静态设置它们,它仍然可以在这个网桥上工作

    # The loopback network interface 
    auto lo 
    iface lo inet loopback 
    # Ethernet ports setup 
    iface eth0 inet manual 
    iface eth1 inet manual 
    iface eth2 inet manual 
    # Network Bridge 
    auto br0 
    iface br0 inet static
            bridge_ports eth0 eth1 eth2 
            bridge_maxwait 30
            address 10.0.0.2
            netmask 255.255.255.0
            network 10.0.0.0
            broadcast 10.0.0.255    
            gateway 10.0.0.1 
            # IP of Router /\
    
    • 0

相关问题

  • 谁能指出我的 802.11n 范围扩展器?

  • 我怎样才能得到一个网站的IP地址?

  • 在一个 LAN 中使用两台 DHCP 服务器

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve