Method of Adding Soft Routes in Linux One:
route add -net 172.16.6.0 netmask 255.255.255.0 gw 172.16.2.254 dev eth0/*
Add a network 172.16.6.0/24 After 172.16.2.254 eth0 *//* -net increase network -host increase host, netmask subnet mask, gw gateway, dev device, device, here is you Network card name */route del gw 172.16.2.254 /* Delete default gateway 172.16.2.254 */route del -net 172.16.86.0/24 /* Delete default network 172.16.86.0 */route /* Display current routing table */commonly used This is the way, but sometimes you will not work when deleting or a soft route, there will be a hint: SIOCADDRT: can not contact the network, so this method can be used as follows.
Method 2 for adding soft routes in Linux:
The function is the same as above
ip route add 172.16.6.0/24 via 172.16.2.254 dev eth0 ip route Del gw 172.16.2.254 ip route del 172.16.6.0/24 dev eth0ip route
Method of deletion: Add route:
Here is the code snippet:
route add -net 10.0.0.0 netmask 255.0.0.0 dev eth0
Deleting Routes:
The following is a code snippet:
route del -net 10.0.0.0 netmask 255.0.0.0 dev eth0
Add default route:
Here is the code snippet
route add default gw 10.0.0.1
Delete default route:
Here is the code Fragment:
route del default gw 10.0.0.1
or
Here is the code snippet:
route del default
under linux Method of adding a route:
Adding a route using the route command
Adding a route using the route command, restarting the machine or restarting the network card By default, the method:
The following is a code snippet:
//Adding a route to the host
# route add –host 192.168.168.110 dev eth0
# route add –host 192.168.168.119 gw 192.168.168.1
//Adding routes to the network
# route add –net IP netmask MASK eth0
# Route add –net IP netmask MASK gw IP
# route add –net IP/24 eth1
//Add default gateway
# route add default gw IP
//Delete route
# route del –host 192.168.168.110 dev eth0
Set permanent route method under linux:
1. In /etc/Add
to rc.local The following is a code snippet:
route add -net 192.168.3.0/24 dev eth0 route add -net 192.168.2.0/24 gw 192.168.3.254
2. Add to the end of /etc/sysconfig/network
Method: GATEWAY=gw-ip or GATEWAY=gw-dev
3./etc/sysconfig/static-router :
Here is Code Snippet:
any net x.x.x.x/24 gw y.y.y.y
The method of adding soft routing in Linux should be able to master and understand, and we will continue to sort out relevant content for your reference.
Record your favorite Linux system commands for easy reference later, and find that memory is getting
self-entertainment, I decided to start a Linux server, then execute the ld & ldquo;rm –rf /&rd
On the linux device model online, there are some discussions, some things I used to use, to modify a
Starting today, I officially entered the development of tiny4412. Today I mainly watched the startu
Linux operating system to install WordPress service
Data transfer on the link layer of the Linux protocol stack (new bridge (3))
Centos hard disk partition three solutions
The first Linux system for tablet launch
How to use the netstat command to view DDOS attacks in Linux?
Commonly used Linux system monitoring commands introduction
Elementary OS Beautiful Linux Overview
Yum installation error: Error: database disk image is malformed Solution
Alternative Uses for Traditional Inputs
Settings after system installation
Microsoft simulation flight landing Win10 browser: super smooth (with game link address)
Win10 dual system set default boot system graphic tutorial
Win7 system boot prompts catalyst control center has stopped how to solve
How does win7 create a dial-up connection?
Win8 graphic password setting method
How to set up wireless and broadband Internet access in Win7 system
What should I do if the win8 wireless network is restricted?
Win7 how to modify the registry to set IE as the default browser