Article title: Network Management-Linux system network configuration details. 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.
1. View IP Ifconfig
2. IP address configuration method:
A. This method takes effect immediately, but will not be saved after restart. (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 how to set multiple IP addresses of one Nic (used when setting a VM)
Enable Nic: Ifconfig eth0 up
Disable Nic: Ifconfig eth0 down
Dynamic acquisition of IP: Ifconfig etho? Dynamic
Dhclient
Modify the Mac value: first disable the Nic Ifconfig eth0 down
Modify the MAC value Ifconfig eth0 hw ether 112233445566.
Then activate the Nic Ifconfig eth0 up
B. Netconfig or Setup, but only Eth0 Nic can be set
C. open the graph window for Neat settings.
D. configuration file settings:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Note: When the Nic Service network restart fails to be restarted after configuration
Use the fourth method to check whether the Bootup in the configuration file is None. if it is DHCP, an error occurs.
3. configure the Gateway:
View Gateway route
Add default route:
Route add? Net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1
Delete default route:
Route del? Net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.1
Linux route configuration:
1. first enable the routing function
Echo 1>/proc/sys/net/ipv4/ip_forward (1: enable routing function 0: disable routing function)
(In this experiment, you only need to enable the routing function)
2. other route settings:
A. Add route 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 Nic of the local machine)
Delete route entries: you only need to change Add to Del.
B. configure the route using Zebra (the configuration is the same as that of Cisco ):
1) set the logon password:
Vi/etc/zebra. conf
Password abc # set the connection password
Enable password 123 # set a privileged password
2) enable the service
Service zebra start
3) create the route protocol file to be configured
For example, use the Rip protocol: touch/etc/zebra/ripd. conf.
4) enable the Rip protocol: service ripd start
5) enter Zebra:
Method 1. Telnet 127.0.0.1 2601 # Remember that the port is 2601
If no password is set, connections are not allowed by default, which is suitable for remote logon.
Method 2: Vtysh # enter without a password. if a password is displayed, it only applies to local logon.
6) the route configuration is the same as that in the Cisco router.
7) exit: quit (save it before exiting)