Home > OS >  Linux network configuration problems
Linux network configuration problems

Time:09-23

Familiar with Linux bosses, I'm puzzled by the question for a long time, I also baidu, but in the end still don't understand, is the figure of the three IP addresses, why don't the second and third IP agreement? Or the first IP do not match the second IP? Bosses will, can you explain it in detail? ,小弟在此感恩不尽!!!!!

CodePudding user response:

IP is X.X.X.X (V4), is made up of four bytes, each byte can take a value of 0-255,

Subnet is logically divided different IP into different groups, adopt the way called mask, also is 4 bytes, in binary is better understood, in the case of/24, said 24 1, 11111111, 1111111, 11111111, 00000000, the decimal is 255.255.255.0, so 10.0.0, X is a subnet, 10.0.1. X is another network,

10.0.0.200/24 is in the subnet 10.0.0, just and 10.0.0.1 within a network,

CodePudding user response:

The first IP screenshot is not complete, but should be a gateway, the second is your virtual machine model of NAT network segment, the third is your IP of this virtual machine

CodePudding user response:

May be the IP address has changed

CodePudding user response:

One is the host's IP, IP is a virtual machine, the host machine's virtual IP service for the virtual machine, finally is not the same as normal

CodePudding user response:

One is the gateway address, one is a sub segments, one is its own IP address

CodePudding user response:

The
reference 7 floor RivenDong response:
is a gateway address, one is a sub segments, one is its own IP address

This I don't agree with, I didn't show the gateway address here, you may also be right, but I think that would be wrong

CodePudding user response:

I am centos7 environment, network card information in the "ens36:192.168.200.40" rather you three figure "eth0:10.0.0.200", this is the network card IP address, can be found through the following methods to modify the file modifications, as for your second figure "10.0.0.0" is a network segment, you follow this change your IP address, but modify IP address must be within your network segment, hope to help you,
IP/root @ mysql2 ~ # a
1: lo: & lt; The LOOPBACK, UP, LOWER_UP & gt; Mtu 65536 qdisc noqueue state UNKNOWN group, the default qlen 1000
The link/loopback 00:00:00:00:00:00 BRD 00:00:00:00:00:00
Inet 127.0.0.1/8 scope host lo
Valid_lft forever preferred_lft forever
Inet6: : 1/128 scope host
Valid_lft forever preferred_lft forever
2: ens33: & lt; BROADCAST and MULTICAST, the UP, LOWER_UP & gt; Mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
The link/Mr 00:0 c: 29: e1:7 f: 53 BRD ff: ff: ff: ff: ff: ff
3: ens36: & lt; BROADCAST and MULTICAST, the UP, LOWER_UP & gt; Mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
The link/Mr 00:0 c: 29: e1:7 f: 5 d BRD ff: ff: ff: ff: ff: ff
Inet 192.168.200.40/24 BRD 192.168.200.255 scope global noprefixroute ens36
Valid_lft forever preferred_lft forever
9 c55 inet6 fe80: : : : 9039 f9b9:13 d/64 scope link noprefixroute
Valid_lft forever preferred_lft forever

/root @ mysql2 ~ # CD/etc/sysconfig/network - scripts

[root @ mysql2 network - scripts] # ls
Ifcfg - ens33 ifdown ifdown - ippp ifdown - post ifdown - sit ifdown - tunnel ifup - bnep registers itself with ifup - ipv6 ifup - plusb ifup - routes ifup - TeamPort init. Ipv6 - global
Ifcfg - ens36 ifdown - bnep registers itself with ifdown - ipv6 ifdown - the PPP ifdown - Team ifup ifup - eth ifup - isdn ifup - post ifup - sit ifup - tunnel network - functions provides
Ifcfg - lo ifdown - eth ifdown - isdn ifdown - routes ifdown - TeamPort ifup - aliases ifup - ippp ifup - plip ifup - the PPP ifup - Team ifup - wireless network - functions provides - ipv6

[root @ mysql2 network - scripts] # vi ifcfg - ens36
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable - privacy
NAME=ens36
UUID=5 cd5cdaf - beb5-30 cb - 9977-9 e825b8e8181
DEVICE=ens36
ONBOOT=yes
IPADDR=192.168.200.40
NETMASK=255.255.255.0
GATEWAY=192.168.200.2

CodePudding user response:

Enable the DHCP first IP is equivalent to the second virtual machine shows the subnet gateway IP and mask 255.225.255.0 mean DHCP section for 10.0.0. X network segment is the last one virtual host request DHCP can automatically obtain IP it is 10.0.0.2-10.0.0.254 between arbitrary IP
  • Related