Linux Network Attribute Configuration sub-dynamic allocation and static designation
Dynamic allocation relies primarily on DHCP servers
static specifies that commands need to be manually assigned
Statically specified commands three family
Ifcfg Family
Iproute2 Family
NM Family
Ifcfg Family:
Ifconfig: interface and address viewing and management
Ifconfig-a Show all interfaces including inactive
Ifconfig Interface Up|down Switch port
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7D/D0/wKiom1bwuryCEwKAAAGd5Xr6hH0861.jpg "title=" capture. JPG "width=" "height=" 341 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:341px; "alt=" Wkiom1bwurycewkaaagd5xr6hh0861.jpg "/>
Ifconfig interface address netmask modifying port IP addresses
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7D/D0/wKiom1bwukOBo9fsAAD_hcgBzlw107.jpg "title=" capture. JPG "width=" "height=" 198 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:198px; "alt=" Wkiom1bwukobo9fsaad_hcgbzlw107.jpg "/>
Route: routing View and management
Route-n View host route entry as a digital representation
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7D/D0/wKiom1bwvG_R_5wlAAFBfJua6O8814.jpg "title=" capture. JPG "width=" "height=" 241 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:241px; "alt=" Wkiom1bwvg_r_ 5wlaafbfjua6o8814.jpg "/>
Route add [-net|-host] target [netmask Nm] [GW GW] [[[Dev] If] Add route
Route del [-net|-host] target [GW GW] [netmask Nm] [[Dev] If] Delete route
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7D/D0/wKiom1bwwCiTDmq2AAGMvHyelOQ370.jpg "title=" capture. JPG "width=" "height=" 303 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:303px; "alt=" Wkiom1bwwcitdmq2aagmvhyeloq370.jpg "/>
Add Delete default route
Route add default GW 192.168.10.1
Route del Default
Netstat: status and Statistics view
Netstat-rn is the same as route-n: Show routing
netstat [--tcp|-t] [--udp|-u] [--udplite|-u] [--sctp|-s] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [-- EXTEND|-E[--EXTEND|-E] [--program|-p]
Common combinations:
-tan: Displays all tcpsockets in digital form
-uan: Displays all udpsockets in digital form
-TNL: Displays the monitor status in digital form Tcpsockets
-UNL: Displays the monitor status in digital form Udpsockets
-TUNLP: Digital display of listening status TCP, Udpsockets related processes and PID
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7D/D1/wKiom1bwxu3RP0RFAAF6lYz9Za8985.jpg "title=" capture. JPG "width=" "height=" 243 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:243px; "alt=" Wkiom1bwxu3rp0rfaaf6lyz9za8985.jpg "/>
Netstat-i displaying all interface statistics
Netstat-iinterface displaying specified interface statistics
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/7D/D1/wKiom1bwyTDhwivSAADTBdXZNIs723.jpg "title=" capture. JPG "width=" "height=" 185 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:185px; "alt=" Wkiom1bwytdhwivsaadtbdxznis723.jpg "/>
Iproute2 Family:
IP [OPTIONS] OBJECT {COMMAND | help}
OBJECT: = {link | addr | route | netns}
IP Link: Network device configuration
IP link set DEVICE {up | \}|multicast {ON | off} |name NEWNAME |mtu MTU |netns PID
IP link Show DEVICE
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/7D/D0/wKioL1bw2izSsHOwAAHf-2sRIBg400.jpg "title=" capture. JPG "width=" "height=" 278 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:278px; "alt=" Wkiol1bw2izsshowaahf-2sribg400.jpg "/>
IP route: Routing table Management
IP route {Add | del | show | flush | get}
Example:
# IP route add 192.168.1.0/24 via 10.0.0.1 dev eth1 src 10.0.20.100
# IP route add default via GW
# IP Route Delete 192.168.2.0/24
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/7D/D2/wKioL1bw45mgt_orAAC_UYkBNRQ475.jpg "title=" capture. JPG "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:84px; "alt=" Wkiol1bw45mgt_ Oraac_uykbnrq475.jpg "/>
# IP Route Get 192.168.3.0/24
IP Address: Management of protocol addresses
IP Address {add | del} ifaddr dev STRING
IP Address {show | flush} [Dev STRING]
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7D/D2/wKioL1bw4_bitBMOAAHv5OQM7Sc231.jpg "title=" capture. JPG "width=" "height=" 282 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:282px; "alt=" wkiol1bw4_ Bitbmoaahv5oqm7sc231.jpg "/>
IP netns: Network namespace management
IP netns list-show All of the named network namespaces
IP netns Add name-create a new named network namespace
IP [-all] netns Delete [name]-delete the NAME of a network namespace (s)
IP [-all] netns exec [NAME] cmd ...-Run cmd in the named Network namespace
SS: Status and Statistics view
SS [Options] [FILTER]
Options
-T,--tcp Display TCP sockets.
-U,--udp Display UDP sockets.
-W,--raw Display raw sockets.
-L,--listening Display only listening sockets (these is omitted by default).
-A,--all Display both listening and non-listening (for TCP This means established connections) sockets.
-N,--numeric do not try to resolve service names.
-E,--extended Show detailed socket information
-M,--memory Show socket memory usage.
-P,--processes Show process using socket.
-O,--options Show timer information.
FILTER: = [State State-filter] [EXPRESSION]
Example
Ss-o State established ' (Dport =: ssh or sport =: SSH) '
Display all established SSH connections.
nm (Network Manager) Family (CentOS 7)
NMCLI: command-line tools
NMCLI [OPTIONS] OBJECT {COMMAND | help}
OBJECT: = {General | networking | radio | connection | device | agent}
General-general NetworkManager Status and operations
COMMAND: = {STATUS | hostname | permissions | logging}
Networking-get or set general networking State of NetworkManager
COMMAND: = {[on | off | connectivity]}
Radio-get or set Radio switch states
COMMAND: = {all | wifi | wwan | wimax}
Connection-start, stop, and manage network connections
COMMAND: = {Show | up | down | add | edit | modify | delete | reload | load}
Device-show and manage network interfaces
COMMAND: = {Status | show | connect | disconnect | delete | wifi | wimax}
modifying properties
Modify [--temporary] [ID | uuid | path] <ID> [+|-]<setting>.<property> <value>
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M02/7D/DC/wKiom1bxCpCTvMO-AAH3TPZ_j8I612.jpg "title=" capture. JPG "width=" "height=" 266 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:266px; "alt=" Wkiom1bxcpctvmo-aah3tpz_j8i612.jpg "/>
Nmtui:text Window Tool
Text User Interface for controlling NetworkManager
Configuration file
Config file for Ip/netmask/gw/dns properties:/etc/sysconfig/network-scripts/ifcfg-iface
It can be directly modified by a text editor such as Vim
650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M00/7D/DD/wKiom1bxFTvACAsMAAHwW0Hjhzo678.jpg "title=" capture. JPG "width=" "height=" 395 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:700px;height:395px; "alt=" Wkiom1bxftvacasmaahww0hjhzo678.jpg "/>
You can also use a dedicated command to modify
CentOS 6:system-config-network (Setup),
CentOS 7:nmtui
Related configuration file for routing:/etc/sysconfig/networkj-scripts/route-iface
Support two configuration methods, but not mixed;
(1) One route entry per line:
TARGET via GW
(2) One route entry per three lines:
Address#=target
Netmask#=mask
Gateway#=nexthop
Note: Using a virtual machine to enable the second block of NIC routing has not been added successfully ....
This article is from the "Liberalism" blog, make sure to keep this source http://edonkey.blog.51cto.com/887243/1754034
Linux Network Properties Configuration