Weisheng Ethereum
Publish: 2021-04-02 07:13:13
1. The configuration of the first network card in Linux system
description of ifcfg-eth0 configuration parameters in Linux:
ifcfg-eth0 is in / etc / sysconfig / network scripts,
its configuration is as follows:
device = physical device name
IPADDR = IP address
netmask = mask value
Network = network address
broadcast = broadcast address
gateway = gateway address
onboot = [yes | no]
userctl = [yes | no] (whether non root users can control the device)
bootproto = [none | static | BOOTP | DHCP] (boot) No protocol | static allocation | BOOTP protocol | DHCP protocol)
hwaddr = MAC address
some parameters are not required
the original configuration is as follows:
device = eth0
bootproto = DHCP
onboot = yes
in this case, the NIC is not activated
the modified configuration is as follows:
device = eth0
bootproto = static
broadcast = 192.168.129.128
IPADDR = 192.168.129.2
netmask = 255.255.255.0
Network = 192.168.129.0
onboot = yes
in this way, the network card can be activated every time it is turned on.
description of ifcfg-eth0 configuration parameters in Linux:
ifcfg-eth0 is in / etc / sysconfig / network scripts,
its configuration is as follows:
device = physical device name
IPADDR = IP address
netmask = mask value
Network = network address
broadcast = broadcast address
gateway = gateway address
onboot = [yes | no]
userctl = [yes | no] (whether non root users can control the device)
bootproto = [none | static | BOOTP | DHCP] (boot) No protocol | static allocation | BOOTP protocol | DHCP protocol)
hwaddr = MAC address
some parameters are not required
the original configuration is as follows:
device = eth0
bootproto = DHCP
onboot = yes
in this case, the NIC is not activated
the modified configuration is as follows:
device = eth0
bootproto = static
broadcast = 192.168.129.128
IPADDR = 192.168.129.2
netmask = 255.255.255.0
Network = 192.168.129.0
onboot = yes
in this way, the network card can be activated every time it is turned on.
2. IP
route
Add
10.89.255.0/24
via
10.89.255.254
dev
eth0
all packets whose destination address is 10.89.255.0/24 have their next hop address (Gateway) of 10.89.255.254 and are sent from the local eth0
interface.
route
Add
10.89.255.0/24
via
10.89.255.254
dev
eth0
all packets whose destination address is 10.89.255.0/24 have their next hop address (Gateway) of 10.89.255.254 and are sent from the local eth0
interface.
3. The main idea is:
add a default global routing record. The target network xx.xx.xx.xx (NextHop via xx.xx.xx.xx) is to be reached through the gateway (Ethernet card eth0), and the link weight is 1
add a default global routing record. The target network xx.xx.xx.xx (NextHop via xx.xx.xx.xx) is to be reached through the gateway (Ethernet card eth0), and the link weight is 1
4. When you arrive at 192.168.100.0, the gateway is 192.168.2.254, through the eth0 interface.
5. The default route should not be added in the way of route-eth0. This should be adding gateway to ifcfg-eth0 file
route-eth0 should be a static route< br />192.168.55.0/24 via 192.168.234.1
route-eth0 should be a static route< br />192.168.55.0/24 via 192.168.234.1
6. IP route add 10.89.255.0/24 via 10.89.255.254 dev eth0
for all packets with destination address of 10.89.255.0/24, the next hop address (Gateway) is 10.89.255.254, which is sent out from the local eth0 interface.
for all packets with destination address of 10.89.255.0/24, the next hop address (Gateway) is 10.89.255.254, which is sent out from the local eth0 interface.
Hot content
