Add a route Entry In debian

Source: Internet
Author: User
Add a route Entry In debian-Linux Release Technology-Debian information. For more information, see the following section. Method 1: Modify/etc/network/interfaces

Auto eth0
Iface eth0 inet static
Address 172.16.3.222
Netmask 255.255.0.0
Network 172.16.0.0
Broadcast 172.16.0000255
Gateway 172.16.2.1
Up route add-net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1
Down route del-net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1


Method 2: create a simple script file under the/etc/network/if-up.d directory, such as static-route $ (remember to end with the $ symbol, otherwise, a run-parts will run to tell you something.) The script is the simplest, for example:

#! /Bin/bash
Route add-net 192.168.0.0 netmask 255.255.255.0 gw 172.16.0.1

Hey, you can also guess the role of other directories under the/etc/network/directory.

I found that in debian, this route setting is only a simple application of its configuration files. You can do more complex applications.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.