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

    1、网卡添加ip

      sudo ip -f inet addr add 192.168.1.197/24  dev eno1

    2、删除路由

      route del -net 192.168.122.0 netmask 255.255.255.0

    destination【网段地址】
    mask【子网掩码】
    gateway【网关地址】
    metric 【路由跳数】
    if【端口号】

     3、添加路由

      sudo route add -net 0.0.0.0 gateway xx.xx.xx.1

    4、网络重启

      1、sudo service networking restart

      2、sudo /etc/init.d/networking restart

    5、路由表查看

             1) 查看路由表

                    sudo iptables -t nat -L -n

      2)   设置路由转发

        sudo iptables -t nat -A POSTROUTING -s [src ip address] -o [eth name] -j MASQUERADE

        sudo iptables-save

  • 相关阅读:
    列表方块与格式与布局
    框架与样式表的基本概念
    表单
    内容容器,常用标签
    CSS3
    表单验证
    练习题
    document对象
    windows对象
    函数
  • 原文地址:https://www.cnblogs.com/Forwarderz/p/13710365.html
Copyright © 2011-2022 走看看