Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Network configuration of Linux system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you the "sample analysis of network configuration of Linux system", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "sample analysis of network configuration of Linux system".

1. View IP Ifconfig

2. The method of configuring IP

A. this method takes effect immediately, but the restart will not be saved. (all other methods except this method can be saved)

Ifconfig eth0 1.1.1.1 netmask 255.0.0.0 up

Ifconfig eth0:1 1.1.1.3 up method of setting multiple IP for a network card (useful when setting up virtual hosts)

Activate the network card: Ifconfig eth0 up

Turn off the network card: Ifconfig eth0 down

Dynamic acquisition of IP:Ifconfig etho-dynamic

Dhclient

Modify Mac value: close the network card Ifconfig eth0 down first

Then modify the MAC value Ifconfig eth0 hw ether 112233445566

Reactivate the network card Ifconfig eth0 up

B, Netconfig or Setup, but only Eth0 Nic can be set.

C, Neat open the graphics window to set up

D, profile settings:

Vi / etc/sysconfig/network-scripts/ifcfg-eth0

Note: if you fail to restart the network card Service network restart after configuration

Using the fourth method to check whether the Bootup in the configuration file is None will generally make an error if it is DHCP.

3. Configure the gateway:

View the gateway route

Add a default route:

Route add-net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1

Delete the default route:

Route del-net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1

Linux routing configuration:

1. Enable the routing function first

Echo 1 > / proc/sys/net/ipv4/ip_forward (1: enable routing; 0: disable routing)

(in this experiment, as long as you turn on the routing function, you will OK)

2. Other routing settings:

A. Add routing information:

Route add-net 10.0.0.1 netmask 255.0.0.0 gw 192.168.0.1

Or route add-net 10.0.0.1 netmask 255.0.0.0 dev eth0 (go out through the first network card of this machine)

Delete the route entry: just change the above Add to Del

B. Configure routing with Zebra (the configuration is the same as that of Cisco):

1) set the login password:

Vi / etc/zebra/zebra.conf

Password abc # set the password when connecting

Enable password 123 # set privileged password

2) start the service

Service zebra start

3) establish the routing protocol file to be configured

If you use Rip protocol: touch / etc/zebra/ripd.conf

4) enable Rip protocol: service ripd start

5) enter Zebra:

Method 1. Telnet 127.0.0.1 2601 # # remember that the port is 2601

If the password is not set, the connection is not allowed by default, which is suitable for remote login.

Method 2. Vtysh # # you can enter without a password. If you have a password, it will be displayed, but it is only suitable for local login.

6) configuring routing is the same as in a Cisco router.

7) exit: quit (remember to save before quitting)

The above is all the contents of the article "sample Analysis of Network configuration of Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report