The configuration of vswitches and vrouters is impossible for you to use hardware. what I bring to you today is a small experiment.You can perform an experiment on the Huawei MA5200G simulator.For specific commands and explanations, I have all written my friends who wish to cook the same dishes with me!
First, I have collected some basic commands for vswitches.Common commands:PCA login: root; Use root UserPassword: linux; password: linux# Shutdown-h now; shutdown# Init 0; Shutdown# Logo
route table is as follows:
# Route [add | del] [-net |-host] target [netmask Nm] [gw Gw] [[dev] If]
Where:
* Add: add a routing rule.
* Del: delete a routing rule.
* Net: the destination address is a network.
* Host: the destination address is a host.
* Target: target network or host
* Netmask: network mask of the destination address
* Gw: Gateway used to route
using the route command, after the machine is restarted or the NIC is restarted, the route becomes invalid. Method: // route reference added to the host # route add-host 192.168.1.11 dev eth0 # route add-host 192.168.1.12 gw 192.168.1.1 // route reference added to the network # route add-net 192.168.1.11 netmask route 255.255.255.0 eth0 # route add-net 192.168.1.11 netmask 255.255.255.0 gw 192.168.1.1 # ro
Recent small mess I use the Ansible batch deployment device access to the log audit system, after the discovery of script execution, the log server side still did not receive the Linux host upload syslog, after troubleshooting the cause of the failure is that the host route is not put throughTo add a route to a host, the instructions are simple:1. Add/Remove Default gateways:Added: Route add default GW GATEWAY_IPDelete: Route del default
192.168.1.1 0.0.0.0 UG 0 0 0 eth0
Configuring static Routes
Route Command
To set and view the routing table you can use the route command to set the command format for the kernel routing table:
# route [Add|del] [-net|-host] target [netmask Nm] [GW GW] [[Dev] If]
Where: add: Adding a Routing rule del: Delete a routing rule-net: The destination address is a network-host
the document DOC1,DOC3,DOC5. After the index is built, the system will automatically generate
The following dr$myindex$i,dr$myindex$k,dr$myindex$r,dr$myindex$x,mytable5 tables (assuming the table is
MyTable, indexed as MYINDX). After the Dml operation, the context index is not automatically synchronized and needs to be exploited
Ctx_ddl.sync_index manually synchronize indexes.
Example:
Create table Docs (ID number primary key, text VARCHAR2 (200));
I. Use the route command in linux to addIf you use the route entry added by the route command, the route becomes invalid after the machine is restarted or the NIC is restarted. The method is as follows:// Route entry to the host# Route add-host 192.168.1.11 dev eth0# Route add-host 192.168.1.12 gw 192.168.1.1// Route added to the network# Route add-net 192.168.1.11 netmask 255.255.255.0 eth0# Route add-net 192.168.1.11 netmask 255.255.255.0
CentOS 6.7 Add all methods for permanent static routes
When using a dual-nic and two gateways at the same time, you need to add a static route. Of course there are still many times that you need to add routes.
Operating system version centos-6.4 64bit
I. Use the route command to add
1. Use the route command to add a route. After the machine restarts or the NIC restarts, the route will become invalid. Method:
// Route entry to the host
# Route add-host 192.168.1.11 dev eth0
# Route add-host 1
Tomcat log cutting and Regular deletion
In the Tomcat software environment, if we allow unlimited growth of log files, the disk will be full one day (nonsense ). Especially when log files grow rapidly, it is necessary to cut and delete log files by log. The following describes how to cut log files.
Chapter 3 system environment1.1 Operating System Environment[Root @ server1 ~] # Cat/etc/RedHat-releaseCentOS release 6.5 (Final)[Root @ server1 ~] # Uname-r2.6.32-431. el6.x86 _ 64[Root @ server1 ~]
=/sbin/init ipaddr = 10.0.14.143 netmask = 255.255.255.252 gw = 10.0.12.1
Of course, you can write a program for string analysis. This is the most conservative and stupid method... You need to write string Analysis on your own.
It is better to solve the problem in the simplest way.
Use sed in the script to implement the following:
#!/bin/baship=`sed -n 's/ /\n/gp' /proc/cmdline | sed -n '/ipaddr/p' | sed -n 's/ipaddr=//gp'`netmask=`sed -n 's/ /\n/gp
General Usage of Linux Route
Route ConfigurationRoute
Route: displays or configures local route information.
The main configuration information of a route table configuration is:
Configuration item
Meaning
Target
Destination Ip host address or Ip address
Gw
Next Hop address
Dev
Next Hop Network Interface
If an ip report needs to be sent from the local machine or an ip datagram is forwarded, Linux w
Show all Routes now#route[Email protected] ubuntu:~# RouteKernel IP Routing TableDestination Gateway genmask Flags Metric Ref use Iface10.147.9.0 * 255.255.255.0 U 1 0 0 eth0192.168.1.0 * 255.255.255.0 U 2 0 0 Wlan0192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0link-local * 255.255.0.0 U 0 0 eth0192.168.0.0 192.168.1.1 255.255.0.0 UG 0 0 0 Wlan0Default 10.147.9.1 0.0.0.0 UG 0 0 0 eth0[Email protected]:~#The result is top-down, that is, which one is in front, which one has precedence, none in front,
t1 ifconfig eth3 172.16.1.200/244. Set the address of eth1 and eth2 ifconfig eth1 192.168.1.1/24Ifconfig eth2 172.16.1.1/245. Set a default route for two NetnsIP netns exec T1 route add default GW 192.168.1.1IP netns exec T2 route add default GW 172.16.1.16. TestingPing eth3 address in Netns T2 in Netns t1IP netns exec T1 ping 172.16.1.200After the above configuration, packets sent from Eth0 are routed thr
Article title: Introduction to static route settings in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Now there are five devices: PC1 connected to ROUT1, ROUT1 connected to ROUT2, ROUT2 connected to ROUT3, and ROUT3 connected to PC2. the topology is shown below:
□---- ○ ---- □
PC1 ROUT1 ROUT2 ROUT3 PC2
The static IP addresses of the five devices ar
(? = Gw)/'; $ str = preg_match ($ parent, $ str, $ match); var_dump ($ match);/** output result: int 1 array (size = 1) 0 => string 'bc' (length = 2 )*/
Resolution: First, find the gw position in the string "abcgwcab", assert that it is true, and then match bc. If you write the regular expression $ parent = '/bc (? = Gw) ca/'; the matching will fail.
Anti-Predic
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.