zoukankan      html  css  js  c++  java
  • linux添加ip、路由相关命令


    1- Linux添加永久路由
    vi /etc/sysconfig/network-scripts/route-eth1
    ADDRESS0=192.168.10.0
    NETMASK0=255.255.255.0
    GATEWAY=10.10.10.254


    2-    添加ip及其路由
    ip
        link:网络接口属性
        addr:协议地址
        route:路由
    link    
        show
            ip -s  link show //详细信息包
            ip link show
        set
            ip  link set dev [up|down]
            ip  link set eth1 up

    addr
        add    
            ip addr add ADDRESS dev DEV
            
        del
            ip addr del ADDRESS dev DEV
        
        show
            ip addr show dev DEV to PREFIX
            
        flush
            ip addr flush dev DEV to PREFIX
                
            ip  addr add 192.168.100.3/24 dev eth1 label eth1:0

            ip  addr del 10.2.2.2/8 dev eth1 //删除地址

            ip  addr show

            ip  addr flush eth1 to 10/8 //删掉10/8 删除地址

            
    ip route add to 10.0.0.0/8 dev eht0 via 172.16.0.1 //添加

    ip route flush to 10/8     //删除

    ip route

  • 相关阅读:
    字符串与字典常用命令
    Python学习之路:字符串常用操作
    Python学习之路:购物车实例
    面试题2017
    c#语法学习
    结构化设计模式-桥接模式
    结构型设计模式-适配器模式
    .Net Cache
    设计模式的六大原则
    uml类图关系
  • 原文地址:https://www.cnblogs.com/flyback/p/5967239.html
Copyright © 2011-2022 走看看