Ethereum admin
when installing Linux, if you have a network card, the installation program will prompt you to give the configuration parameters of TCP / IP network, such as the IP address of the local computer, the IP address of the default gateway, the IP address of DNS, etc, The installation program will automatically compile the network card (Linux system must first support) driver into the kernel. But we must understand the process of loading the network card driver, so we can easily operate when changing the network card and using multiple network cards in the future. The network card driver is loaded into the kernel as a mole, All the network card drivers supported by Linux are stored in the directory / lib / moles / (Linux version number) / net /, for example, the driver of Inter's 82559 series 10 / 100M self-adaptive boot network card is eepro100. O, 3Com's 3c509 isa network card is 3c509. O, dlink's PCI 10 network card is via Rhine. O, NE2000 compatible network card drivers are ne2k PCI. O and ne. O. after understanding these basic drivers, we can change the network card or add the network card by modifying the mole configuration file.
1. Modify the / etc / conf.moles file
this configuration file is an important parameter file to load the mole, Let's first look at a sample file
# / etc / conf.moles
alias eth0 eepro100
alias eth1 eepro100
this file is the content of conf.moles in a Linux system with two inter 82559 series network cards. The alias command indicates the name of the driver that the Ethernet port (such as eth0) has, If you use the command modprobe eth0, the system will automatically load eepro100. O into the kernel, Therefore, it is not necessary to use options in conf.moles to specify the IO address and interrupt number of the network card. However, corresponding to isa network card, you must specify the IO address or interrupt number of the hardware in conf.moles, as shown below, It shows a conf.moles file of NE isa NIC.
alias eth0 ne
Options ne IO = 0x300 IRQ = 5
after modifying the conf.moles file, you can use the command to load the mole, For example, to insert the second network card of inter:
? Insmod / lib / moles / 2.2.14/net/eepro100. O
in this way, the mole eepro100. O can be loaded at the Ethernet port, You can also use the command to view the currently loaded mole information:
[ root@ice /Etc] # lsmod
mole size used by
eepro100 15652 (autoclean)
the meaning of the returned result is that the currently loaded mole is eepro100, with 15652 bytes in size and two users, The method is to clear automatically.
2. Modify the / etc / lilo.conf file
in some relatively new Linux versions, because the operating system automatically detects all related hardware, there is no need to modify the / etc / lilo.conf file at this time, You can modify the lilo.conf file. Add the following command to the / etc / lilo.conf file:
append = & quot; ether=5,0x240,eth0 ether=7,0x300,eth1" <
the meaning of this command is that the IO address of eth0 is 0x240, the interrupt is 5, the IO address of eth1 is 0x300, and the interrupt is 7.
in fact, this statement comes from the parameter passed when the system boot image file,
Lilo: Linux ether = 5,0x240, eth0 ether = 7,0x300, eth1
this method can also make the Linux system configure two network cards, When using more than three network cards, you can follow the same method.
after configuring the network card, you should configure the TCP / IP parameters. In general, when installing the Linux system, you will be prompted to configure the network parameters, You can use the following commands:
? Ifconfig eth0 a.b.c.d netmask e.f.g.h
a.b.c.d is the IP address of eth0, and e.f.g.h is the netmask.
in fact, in Linux system, we can set multiple IP addresses for a network card, such as the following command:
? Ifconfig eth0: 1 202.112.11.218 netmask 255.255.192
then, Use the command "ifconfig - a" to see the interfaces of all network interfaces:
eth0 link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.13.204 Bcast :202.112.13.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
RX packets:435510 errors :0 dropped:0 overruns :0 frame:2
TX packets:538988 e rrors:0 dropped :0 overruns:0 carrier :0
c ollisions:318683 txqueuelen :100
I nterrupt:10 Base address:0xc000
eth0:1 Link encap:Ethernet HWaddr 00:90:27:58:AF:1A
inet addr:202.112.11.218 Bcast :202.112.11.255 M ask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:1
I nterrupt:10 Base address:0xc000 < br />
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask :255.0.0.0
UP LOOPBACK RUNNING MTU:3924 M etric:1
RX packets:2055 errors :0 dropped:0 overruns :0 frame:0
TX packets:2055 errors :0 dropped:0 overruns :0 carrier:0
c ollisions:0 txqueuelen : 0
we can see that there are three network interfaces, eth0, eth0:1, lo, Eth0 is the real Ethernet interface. Eth0:1 and eth0 are the same network card, but they are bound with another address. Lo is the sending address. Eth0 and eth0:1 can use IP addresses of different network segments, which is very useful when the same physical network segment uses different network addresses<
in addition, the network card has a mode of prosimc. In this mode, the network card will receive all the packets in the network. Some network monitoring tools under Linux, such as tcpmp and snort, all set the network card to hybrid mode.
the ifconfig command can change the IP address of the network card ring the running time, but if the system is restarted, the IP address of the network card will be changed, Linux still starts the network interface according to the original default settings. At this time, you can use netconfig or NETCONF command to reset the default network parameters. Netconfig command is to reconfigure the basic TCP / IP parameters, including whether to dynamically obtain IP address (dhcpd and BOOTP), IP address of network card, network mask, default gateway and preferred domain name server address. NETCONF command can configure all network parameters in detail, which is divided into three parts: client task, server task and other configuration. In the client configuration, it mainly includes the configuration of basic host (host name, valid domain name, network alias, IP address of corresponding network card, network mask, network device name, kernel driver of network device), DNS address configuration, default gateway address configuration, NIS address configuration, IPX interface configuration, PPP / slip configuration and so on. In the server configuration, it mainly includes the configuration of NFS, DNS, Apache webserver, samba and Wu ftpd. Among the other configuration options, one is about the host configuration in the / etc / hosts file, one is about the network configuration information in the / etc / networks file, and the last is about the configuration information using linuxconf
under the command of linuxconf, you can also configure the network information, but you can find that the linuxconf program calls NETCONF to configure the network
in addition, the system configuration files about the network are stored in the / etc / sysconfig / network scripts directory. Examples are as follows:
: & lt; br>& lt; br>
ifcfg-eth0 * ifdown post * ifup aliases * ifup PPP *
ifcfg-eth1 * ifdown PPP * ifup IPX * ifup routes *
ifcfg lo * ifdown sl * ifup PLIP * ifup sl *
ifdown @ ifup @ ifup post * network functions
ifcfg-eth0 is the configuration information of Ethernet port eth0, and its contents are as follows:
device = & quot; eth0" /* Specify the network device name * /
IPADDR = & quot; 202.112.13.204" /* Indicate the IP address of the network device * /
netmask = & quot; 255.255.255.192" /* Specify network mask * /
Network = 202.112.13.192 / * specify network address * /
broadcast = 202.112.13.255 / * specify broadcast address * /
onboot = & quot; yes" /* Indicates whether the network card is activated at system startup * /
bootproto = & quot; none" /* Indicates whether to use BOOTP protocol * /
therefore, we can also modify this file to change the network parameters under Linux[/ Size]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -, It introces the files related to the configuration of Linux network services.
1. The configuration file of Lilo
in Linux system, there is a system boot program, Lilo (Linux loadin), which can be used to realize the selective startup of multiple operating systems. Its configuration file is / etc / lilo.conf.in this configuration file, the configuration parameters of Lilo are mainly divided into two parts, One is the global configuration parameters, including setting the boot device and so on. The other is the local configuration parameters, including the configuration parameters of each boot image file. I will not describe each parameter in detail here, but only two important parameters: password and restricted option. The password option adds password protection to each boot image file.
as we all know, In Linux system, there is a single user mode. In this mode, the user logs in to the Linux system as a super user. By adding parameters (Linux single or Linux init 0) ring Lilo boot, people can directly enter the single user mode super user environment without password, This will be very dangerous. So the password configuration option is added in lilo.conf to add password protection to each image file.
you can use the password option in global mode (add the same password to all image files), or add a password to each indivial image file, You may find it troublesome to enter the password every time. You can use the restricted option, which enables Lilo to check the password only when the parameters (such as Linux single) are entered ring Linux startup. These two options can greatly increase the security of the system, It is recommended to set them in lilo.conf file.
since password is stored in plaintext in / etc / lilo.conf file, it is necessary to change the attribute of / etc / lilo.conf file to only root readable (0400).
in addition, in the early version of Lilo, there was a limitation that the boot sector must be stored in the first 1024 cylinder, which was broken in Lilo version 2.51, After downloading and decompressing the latest version, use the command make & quot; Note: physical security is the most basic security, even if the password protection is added in lilo.conf, if there is no password protection in lilo.conf
to save the IP address, if your system supports commands such as setup or netconfig, you can use these commands to configure the interface. You can also directly edit the corresponding network interface configuration file, / etc / sysconfig / network scripts / ifcfg-eth0, the content is as follows:
# Advanced Micro Devices [amd] 79c970 [pcnet32 lance]
device = eth0 # interface name
bootproto = none # indicates how to obtain IP, there are three parameters to choose, static manually specify IP, DHCP uses DHCP to obtain IP, None indicates that no protocol is used ring startup.
hwaddr = 00:0c: 29:34: AD: 70 ᦇ indicates the MAC address to be used. You can not use
onboot = yes ᦇ whether to start this interface or not. You can choose either yes or no
netmask = 255.255.255.0 ᦇ subnet mask
iPad Dr = 192.168.0.3 ᦇ IP address
gateway = 192.168.0.1 ᦇ gateway
type = Ethernet ᦇ network type corresponding to the interface, This is Ethernet, or you can not use this option
all field names above are capitalized.
The password of Tianyi broadband home gateway generally defaults to: admin. There is a label on the device body, which has an account number and password. If the broadband user name and password, you need to ask the network provider. They will usually write it to you when they set it, or you can call to ask
generally, the login account of telecom broadband cat can't be set by itself, which can only be set by using the special account and password of Telecom installation and maintenance staff. Setting it by yourself may cause the broadband can't be used
extended data:
the access mode of Tianyi broadband
1, ADSL
< ADSL (asymmetric digital subscriber loop) are called "modern information superhighway". The commonly used downlink rate can reach 8 Mbps and the uplink rate can reach 640 Kbps, which has the characteristics of high speed, wide bandwidth, excellent performance and wide coverage
2. LAN
uses Ethernet technology to provide users with fttz (fiber to cell) + LAN cable to home broadband access. Basically achieve Gigabit to community, 100 trillion to residential buildings, 10 trillion to users. No modem, high reliability, just an Ethernet card can easily access the Internet
3. Special Internet service
special Internet access service refers to providing customers with special optical fiber Internet access link, directly accessing China Telecom's broadband network, meeting the demand of 10-1000 megabit rate, and realizing convenient and fast high-speed Internet access service
vim /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.254
ONBOOT=yes
BOOTPROTO=static
配置完成后保存,退出
service network restart
主机名:
hostname server.e.cn
或者
vim /etc/hosts
192.168.100.100 server.e.cn
DNS :
vim /etc/resolv.conf
nameserver 202.103.0.117
nameserver 61.128.100.10
