zoukankan      html  css  js  c++  java
  • gentoo 网络配置

    假定用户已配置好内核和硬盘,使用的网卡是eth0.

    首先先建立符号链接

    root #cd /etc/init.d
    root #ln -s net.lo net.eth0
    所有的网络接口都在/etc/conf.d/net里配置,下面是一些示例
    # For DHCP
    config_eth0="dhcp"
      
    # For static IP using CIDR notation
    config_eth0="192.168.0.7/24"
    routes_eth0="default via 192.168.0.1"
    dns_servers_eth0="192.168.0.1 8.8.8.8"
      
    # For static IP using netmask notation
    config_eth0="192.168.0.7 netmask 255.255.255.0"
    routes_eth0="default via 192.168.0.1"
    dns_servers_eth0="192.168.0.1 8.8.8.8"

    CIDR是一个ip爆满的解决方案,允许一个IP地址指定许多IP地址

    现在配置完成了,我们可以启动或者关闭它

    root #/etc/init.d/net.eth0 start
    root #/etc/init.d/net.eth0 stop
     
    tips:网络不一定叫net.eth0  请用ifconfig -a 来看看网卡具体叫什么名字,再前面建立软连接到net.lo的时候也用那个网卡的名字  /etc/conf.d/net里的名称也要用新的网卡名称 详情请参考http://allogs.ml/linux/linux%E5%AE%B6%E6%97%8F%E7%A5%9E%E5%99%A8-gentoo%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2%E6%95%99%E7%A8%8B-%E5%AE%89%E8%A3%85%E5%85%A8%E7%A8%8B%E7%AC%94%E8%AE%B0.html
     
    下一步就是在引导的时候开启网卡
    root #rc-update add net.eth0 default
    root #rc
     
     
    到这我们网络就配置好了,具体的其他详情信息请查看wiki帮助文档
    https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Networking
     
     
  • 相关阅读:
    [JZOJ3386] 守卫者的挑战
    [JZOJ3385] 黑魔法师之门
    [JZOJ3383] 太鼓达人
    [JZOJ3382] 七夕祭
    NOIP模拟测试on 2019.9.27
    数据结构测试2 on 2019.9.25
    数据结构测试1 on 2019.9.24
    P2047 [NOI2007]社交网络
    P2286 [HNOI2004]宠物收养场
    P1342 请柬 建反图+dijkstra
  • 原文地址:https://www.cnblogs.com/Garin/p/6297415.html
Copyright © 2011-2022 走看看