Linux notes--Network configuration ifconfig and IP

Source: Internet
Author: User
Tags nameserver

Mac:media Access contro

Coaxial transmission signal

Line arbitration: At some point which annotations can use this transmission medium

CSMA/CD: Carrier audiometry Multi-access, conflict detection (Ethernet Ethernet)

Repeater: Amplification voltage, the electron in the transmission process will collide, voltage drop

Bridge: Divide the main axis of the host into two parts, reduce the signal conflict, different parts of the host can send a signal

Switch: In fact, the multi-port bridge is a switch, can be divided into many parts of the coaxial host, can communicate with each other, but also can communicate with different host

Subnet Mask: Compute network address based on IP address

IPV4: Dotted decimal, four part three points separated, each part consists of 8 bits binary

IPV4 Category: A 1-126 (127 for loopback) B 128-191 C 192-223 D 224-239 E 240-255
Subnet mask for Class A: 255.0.0.0 (8)
Subnet mask corresponding to Class B: 255.255.0.0 (16)
Subnet mask corresponding to Class C: 255.255.255.0 (24)

Private addresses cannot be used to surf the Internet:
A:10.0.0.0/8
B:172.16.0.0/16--172.31.0.0/16
C:192.168.0.0/24--192.168.255.0/24

Routing
Host route: The destination address is a host
Network routing: The destination address is a network

Ifonfig:-A: Displays configuration information for all interfaces Ifconfig [eth#]: Specify View ifconfig eth# 10.1.1.4/8 (ip/mask) [up | down]: Specify the IP address and subnet mask for a device
The configured address takes effect immediately, but restarting the network service or host fails the RH5 network file:/etc/init.d/network {start | stop | restart | statas} RH6 Network configuration file:/etc/networkmanag er/networkmanager.conf {Start | stop | restart | statas}

Gateway: Route add Add Route del Delete (-host: Host route-net: Network route default: Routing without parameters) route No parameter view local route (U: local network ug: Gateway route)-N: Digital display of each host or Port
Example: Route add default GW (Nexthop)
Route Del-net 10.0.0.1/8
Route del Default
Changes take effect immediately, but restart Network service or host after failure profile:/etc/sysconfig/network Interface profile:/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG Interface Name (device: Associated unit name To be consistent with the second half of the file name Bootproto: {static | none | DHCP | BOOTP} Boot Protocol IPADDR:IP address Netwask: Subnet mask Gateway: Set Gateway route Onboot: Automatically activates this interface HWADDR: Hardware address (can save) Userctl: {yes | No} allows ordinary users to control this interface Peerdns: {yes | No} whether the DNS address specified by the DHCP server is accepted when Bootproto is DHCP)
Does not take effect immediately, restarting the network service or host will take effect (/etc/init.d/network restart)
Static address: Use Static or none (DHCP means get address using DHCP server)

Adding routes manually
Add File:/etc/sysconfig/network-scripts/route-eth#
Add format one: DEST via Nexthop
Add format two: addresso= (IP)
netmashko= (Gateway)
Gatemayo= (Next hop address)

DNS server specified method:/etc/resolv.conf
NameServer dns-ip-1
NameServer dns-ip-2
Specify local resolution:/etc/host
Host IP---Host name---host Alias
DNS-----
(hostname hostname: can also change host name, effective immediately, but not permanently)
Setup: Command graphical interface to modify the network and save directly to the configuration file

Ip:ip Link View the configuration properties of the network Interface (addr protocol address Route route address) Ip-s Link Show: Detailed statistics IP link set dev (device name) {up | Down}
IP addr Add ADDRESS dev Dev
IP addr del ADDRESS dev Dev
IP addr Show Dev dev to PREFIX
IP addr Flush Dev dev to PREFIX

Netstat command:
-N with Digital display
-R Display Routing table
-T TCP connection established
-U appears UDP connection
-L display connection for listening status
-P Displays the process number and process name of the process that listens on the specified socket

This article is from the "stupid Bird first-FAI" blog, please be sure to keep this source http://benniaoxianhui.blog.51cto.com/10463960/1679217

Linux notes--Network configuration ifconfig and IP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.