1, view Ip:ifconfig
2, configure the IP method:
A, this method takes effect immediately, but the reboot 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//Set up a method of multiple IP for a network card (useful when setting up a virtual host)
Activate network card: Ifconfig eth0 up
Turn off the NIC: Ifconfig eth0 down
Dynamic acquisition of Ip:ifconfig Etho–dynamic
Dhclient
To modify the Mac value: First turn off the NIC: Ifconfig eth0 down
To modify the Mac value again: Ifconfig eth0 hw ether 112233445566
Then activate the NIC: Ifconfig eth0 up
B, Netconfig or setup, but only Eth0 network adapters can be set
C, Neat: Open the graphics window to set
D, configuration File settings:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Note: When the network adapter service network Restart fails, the fourth method is used to check if the bootup in the configuration file is None, and if it is DHCP, it will generally be wrong.
3, configure the Gateway:
View Gateway: Route
To add a default route:
Route add–net 0.0.0.0 netmask 0.0.0.0 GW 192.168.0.1
To delete a default route:
Route del–net 0.0.0.0 netmask 0.0.0.0 GW 192.168.0.1
Linux Routing configuration:
1, first turn on the routing function
Echo 1 >/proc/sys/net/ipv4/ip_forward (1 for open routing function, 0 for off routing function)
(In this experiment, just turn on the routing function 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 (through the first network card of this machine out)
To delete a route entry: Just change the above add to Del.
B, configure routing with zebra (configuration is the same as Cisco's command):
1) Set the login password:
Vi/etc/zebra/zebra.conf
Password ABC #设置连接时的密码
Enable Password 123 # set Privileged password
2) Open Service
Service Zebra Start
3 Establish the Routing protocol file to configure
For example, RIP protocol: touch/etc/zebra/ripd.conf
4 Open RIP Protocol: Service RIPD start
5) Enter Zebra:
Method One, Telnet 127.0.0.1 2601 # # Remember the port is 2601
If no password is set, the connection is not allowed by default and is suitable for remote logins
Method II, Vtysh # # No password can also be entered, if the password will also be displayed, but only for local logins.
6 Configure routing: it's the same as in the Cisco router.
7 exit: Quit (remember to save before exiting)