The process deadlock occurs when you use the routeadd command. Please give me some advice! -- Linux general technology-Linux programming and kernel information. The following is a detailed description. My C program executes system ("route del default; route add default gw 2.11.2.1 dev eth3"); after several processes are started, the parent process is killed, the executed shell process becomes an orphan process. As a result, the process is deadlocked a
up
(4) disable the device.
# Ifconfig eth0 down
(5) view the configuration of the specified network interface.
# Ifconfig eth0
(6) view all network interface configurations.
# Ifconfig
2. route
You can use the route command to configure and view the configuration of the kernel route table.
For example:
(1) route added to the host.
# Route add? Host 192.168.1.2 dev eth0: 0
# Route add? Host 10.20.30.148 gw 10.20.30.40
(2) route added to the network.
1. Add the following content to the/etc/rc. Local file:Note: eth0 binds the Intranet IP address eth1 and the Internet IP Address################[Root @ rhnat01 root] # vi/etc/rc. Local#! /Bin/sh## This script will be executed * after * all the other init scripts.# You can put your own initialization stuff in here if you don't# Want to do the full sys V style init stuff.Touch/var/lock/subsys/localRoute add-net 0.0.0.0 GW Internet gateway netmask 0.0.0.
enabled) running (indicating that the network card is connected) multicast (supporting Multicast) MTU: 1500 (maximum transmission unit): 1500 bytes
4. Five Elements: Statistics on received and sent data packets
Row 7: number of bytes of received and sent data.
(1) configure the IP address of eth0 and activate the device.
# Ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
(2) configure the IP address of the eth0 alias device eth0: 1 and add a route.
# Ifconfig eth0: 1 192.168.1.3
1. ifconfigYou can use the ifconfig command to configure and view the network interface configuration.
For example:
(1) configure the IP address of eth0 and activate the device.
# Ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
(2) configure the IP address of the eth0 alias device eth0: 1 and add a route.
# Ifconfig eth0 192.168.1.3
# Route add-host 192.168.1.3 dev eth0: 1
(3) activate the device.
# Ifconfig eth0 up
(4) disable the device.
# Ifconfig eth0 down
(5) view the configuration of t
settings under the command line, using the set DNS command, you can enter set dns /? View the usage method.
Finally, we save these commands as a bat file (setip192168423.bat ):CopyCodeThe Code is as follows: @ echo offRem ETH // ETH is the name of the network adapter, which can be queried in the network connection, for example, "Local Connection"Set Eth = "Local Link"Rem IP // ip address you want to changeSet IP = 192.168.4.23Rem GW //
Use the following command to configure the Ethernet
1. ifconfig
You can use the ifconfig command to configure and view the network interface configuration.
For example:
1) configure the IP address of eth0 and activate the device.
# Ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
2) configure the IP address of eth0: 1 and add a route.
# Ifconfig eth0: 1 192.168.1.3
# Route add-host 192.168.1.3 dev eth0: 1
3) activate the device.
# Ifconfig eth0: 1 up
4) disable the device.
# Ifconfig eth0: d
I used to set multiple ip addresses of different network segments on the local machine, and then switch the route so that different network segments can go out through different gateways, you can access multiple networks at the same time. However, I often find that some problems may occur, so I decided to use the most primitive method to solve the problem, that is, to use only the ip address of a certain network segment, in this way, you need to constantly change the IP address. Of course, this
Linux under route commandIn order for the device to access another subnet, you need to increase the routing to the sub-network in the device, here are some information. The basic operations are as follows:In general, to be able to access other subnets to set up the route, for example, your host is in 192.168.10.0/24, and you want to access the 192.168.20.0/24 network host, of course, you know a gateway IP, For example 192.168.10.1 (must be on the same subnet as your host), you can configure the
One: Use the route command to add use the route command to add the route, the machine restarts or the network card restarts after the route is invalidated, method: //added to the host Route #route add–host192.168.1.11deveth0#routeadd–host 192.168.1.12gw192.168.1.1//routes added to the network #routeadd–net192.168.1.11 netmask255.255.255.0eth0#routeadd–net192.168.1.11 netmask255.255.255.0gw192.168.1.1#routeadd–net 192.168.1.0/24eth1//Add a default gateway #routeadddefaultgw192.168.2.1/ /Remove R
SELinux user mappingpasswd GWTo increase the use of GW, one thing to note, useradd add a user, do not forget to set a password for him, or the system will not be logged on by default(It can be unlocked with usermod-u GW and cannot be fully unlocked after version six, but manually removed in/etc/passwd!) No.2, modify the userusermod-d/home/test-g test2 GWChange the login directory of the test user to/home/t
that the NIC is having problems receiving;The number of errors packets in the TX packets is too large to indicate that there is a problem when sending the NIC;RouteThe syntax for the route command is:Route [-cfvnee]Route [-v] [-A family] add [-net|-host] target [netmask Nm] [GW GW] [metric N] [mod] [reinstate] [[Dev] If]Route [-v] [-A family] del [-net|-host] target [G
Copy Code code as follows:
@echo off
REM ETH//eth is the name of the network adapter, which can be queried in a networking connection, such as "local link"
Set eth= "Wireless network Connection"
REM IP//ip for the IP you want to change
Set ip=192.168.1.8
REM GW//GW for gateway address
Set gw=192.168.1.1
REM netmasks//netmasks for subnet masks
Set net
and then copy the following code into:
@echo off
REM ETH//eth is the name of the network adapter, which can be queried in a networking connection, such as "local link"
Set eth= "Wireless network Connection"
REM IP//ip for the IP you want to change
Set ip=192.168.1.8
REM GW//GW for gateway address
Set gw=192.168.1.1
REM netmasks//netmasks for subnet masks
Nowadays, with more and more users of the Win7 system using laptops, laptops have the incomparable advantage of desktop, which is to carry conveniently. Users can use the notebook computer in different places, but because of the system IP address setting reason, the user is unable to connect the network when using the notebook computer, but often changes the IP to be very troublesome. So what's the best way to solve this problem? In fact, we can quickly change the IP through batch files, the fol
Divided into system routing, network card routing (redhat8 above), static routing
System routing can be set in/etc/sysconfig/network
Network card routing can be set in/ETC/SYSCONFIG/NEWORK-SCRIPT/IFCFG-ETHX
Static routing in/etc/sysconfig/networking/device/can be set in Ethx.route, static route as the name implies, is fixed, set up the general will not easily change the route
Reproduced:
http://tieba.baidu.com/f?kz=636594999
Static routing configuration files in Linux
Static routing: Many
1, IfconfigYou can use the Ifconfig command to configure and view the configuration of network interfaces. For example:(1) Configure the IP address of the eth0 and activate the device at the same time. #ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up(2) Configure the IP address of the eth0 alias device eth0:1 and add the route. #ifconfig eth0 192.168.1.3 #route add–host 192.168.1.3 Dev eth0:1(3) Activate the device. #ifconfig eth0 up(4) Disable the device. #ifconfig eth0 Down(5) Vie
650) this.width=650; "style=" width:600px;height:536px; "src=" https://s3.51cto.com/wyfs02/M02/A7/7E/ Wkiol1nnr57annlkaac4zaoh7_c559.png "title=" 2017-10-18 20-34-29 screen. png "border=" 0 "height=" 536 "hspace=" 0 "vspace=" 0 " Width= "alt=" Wkiol1nnr57annlkaac4zaoh7_c559.png "/>Experimental Purpose:1, add PC1 join VLAN10,PC2J join VLAN20,PC3 join the VLAN30;2, SW2 and SW3 play the role of the route, V10 and VLAN20 mainly in SW2 run, VLAN30 on SW3, and to ensure SW2 and SW3 one of the bad, PC1
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.