zoukankan      html  css  js  c++  java
  • ip route ifconfig 基本命令

    1.route命令

    route –n

    route add –net 192.168.2.0/24 dev eth0

    route add –net 192.168.2.0 netmask 255.255.255.0 dev eth0

    route add default gw 192.168.1.1 dev eth0

    route del default gw 192.168.1.1

    2.ifconfig命令

    ifconfig eth0 192.168.1.1

    ifconfig eth0:0 192.168.1.1/24

    ifconfig eth0:1 192.168.1.1 netmask 255.255.255.0

    ifconfig eth0:0 down

    ifconfig eth0 up

    3.ip命令

    ip link show

    ip –s link show

    ip link set eth0 up

    ip link set eth0 down

    ip link set eth0 name vbird --需要先关闭网卡ip link set eth0 down

    ip link set eth0 address aa:aa:aa:aa:aa:aa

    ip addr show

    ip addr add 192.168.50.50/24 dev eth0 label eth0:1

    ip addr del 192.168.50.50/24 dev eth0

    ip route show

    ip route add 192.168.5.0/24 dev eth0

    ip route add 192.168.10.0/24 via 192.168.5.100 dev eth0

    ip route add default via 192.168.1.254 dev eth0

    ip route del 192.168.10.0/24

    ip route del default

    ip neigh --查看邻居mac

    ip neigh add 192.168.1.2 lladdr aa:bb:cc:dd:ee:ff dev eth0 nud permanent

    ip neigh del 192.168.1.2 dev eth0

    ip neigh flush all

    本文作者:fcing
    本文出处:https://www.cnblogs.com/fcing
    版权声明:本博客所有文章除特别声明外,均采用CC BY-NC-SA 4.0 许可协议。转载请注明出处!
  • 相关阅读:
    Best Time to Buy and Sell Stock III
    Valid Palindrome
    Longest Substring Without Repeating Characters
    Copy List with Random Pointer
    Add Two Numbers
    Recover Binary Search Tree
    Anagrams
    ZigZag Conversion
    Merge k Sorted Lists
    Distinct Subsequences
  • 原文地址:https://www.cnblogs.com/fcing/p/9363504.html
Copyright © 2011-2022 走看看