First edit the/etc/network/interfaces file and execute the following command in the terminal
sudo vi/etc/network/interfaces
To configure a static IP address
The contents to be edited are as follows:
Auto Eth0 # #自动启用第一块网卡
ifconf eth0 inet Static
Address 192.168.1.2 # #IP地址
netmask 255.255.255.0 # #子网掩码
Gateway 192.168.1.1 # #网关
You can also do this:
Enter in the terminal
sudo ifconfig address 192.168.1.2 # #设置IP
sudo ifconfig
author's server has two Ethernet cards, which are set in eth0 and eth1 respectively during core activation. These two cards are SN2000 ISA adapter cards without jumping feet, and most Linux systems recognize these two cards. The initialization steps of the author's Ethernet network are set in rc. inet1. The command is as follows:
IPADDR = "207.175.253.15" # Replace it with the IP address of your cable modem. NETMASK
example in this article, to describe how to set "IP camouflage" (you can go to Ghost "IP camouflage" for more details ).
In addition, some applications such as the non-standard packages used by RealAudio and CU-SeeME require special modules. You can also obtain relevant information from the above websites.
The author's server has two Ethernet cards, which are set in eth0 and eth1 respectively during core activation. These two cards are SN2000 ISA adapter cards without jumping feet, and mo
downward compatibility. Therefore, the author will take IPFWADM as an example in this article, to describe how to set "IP camouflage" (you can go to http: // scheme ).
In addition, some applications such as the non-standard packages used by RealAudio and CU-SeeME require special modules. You can also obtain relevant information from the above websites.
The author's server has two Ethernet cards, which are set in eth0 and eth1 respectively during core activation. These two cards are SN2000 ISA a
author's server has two Ethernet cards, which are set in eth0 and eth1 respectively during core activation. These two cards are SN2000 ISA adapter cards without jumping feet, and most Linux systems recognize these two cards. The initialization steps of the author's Ethernet network are set in rc. inet1. The command is as follows:
IPADDR = "207.175.253.15"
# Change to the IP address of your cable modem.
NETMASK = "255.255.255.0"
# Change to your netwo
;
Typedef struct _ code3 {
Char sign;
Char type;
Short len;
Int id;
Int unk0;
Int code1;
Int unk1;
Int code0;
Int check;
Int unk2;
Char mac [6];
Char dhcp;
Char devtype;
Int ipaddr;
Int netmask;
Char padding [48];
} Code3;
Int waitdata (int hsocket, int time)
{
Fd_set fds;
Struct timeval TV;
FD_
Linux Shell script automatically modifies the IP address and the ip address of the linuxshell script
As a LinuxSA, scripts are used in routine O M, while static ip addresses or MAC binding are used for server ip addresses. Of course, the latter operations are relatively cumbersome, in the former, we can set the host name, ip address information, gateway, and other configurations. Modification to a specific host name is also convenient for maintenance and management. The following script is used
: fe94: c808/64
IP6. Gateway:
Enter the subject
Go to the NIC configuration file directory
# Cd/etc/sysconfig/network-scripts
Rename the NIC
# Mv ifcfg-eno16777736 ifcfg-eth0
Modify the NIC information, not very familiar friends please refer to my another detailed explanation of http://baoer7758.blog.51cto.com/8187563/1638229
# Vim ifcfg-eth0.
HWADDR = 00: 0c: 29: 94: c8: 08
TYPE = Ethernet
BOOTPROTO = static
DEFROUTE = yes
PEERDNS = yes
PEERROUTES = yes
20174_failure_fatal = yes
NAME = eth
under two subnets (0 or 1 !)Net ID
200.200.200.00000000
Netmask quota 0000000000000000
Subnet 1:
Net ID 200.200.200.00000000
Netmask quota 00000000000(The mask is to use 1 to identify the network ID. See the blue part)
Subnet 2:
Net ID 200.200.200.0000000
Netmask quota 00000000000
Next, divide the system into four subnets, and use any of the above subnets. Use
I would like to ask you a question about linux Static Routing-Linux Enterprise Application-Linux server application. The following is a detailed description. When I was learning linux Static Routing, I encountered this problem:
In the Redhat9.0 environment, set the specified CIDR Block route
(1) The online references are as follows:
# Route add-net 192.168.3.0 netmask 255.255.255.0 gw 192.168.6.66
(2) The books on hand are written as follo
The network configuration commands under Linux include Ifconfig, route, where ifconfig is used to view and configure the network interface information, including the IP address, mask, etc. of the network interface. The route is typically used to manage routing information in the Linux kernel. Its greatest purpose is to set static routing table entries. Usually is in the system with Ifconfig configuration network interface, use it to set the host or the IP address of a network segment should be s
-1023: Fixed allocation, and only administrators have permission to enable;
1024-4W: Semi-fixed
4w+: temporary;
Only one process per port can be run at a time
IP addresses are used to identify the source and destination hosts and processes
MAC: Local communication: Range: Local LAN any Internet traffic must be switched to local
IP: Define communication host, source and target, range: Internet
Port: Define the process; scope; host
Network configuration:
The Linux host is involve
10. Address Translation (NAT)
The NAT configuration of a firewall is basically the same as the NAT configuration of a router, and it must first define the internal IP address group for NAT conversion, and then define the internal network segment.
The command that defines the internal address group for NAT conversion is NAT, which is in the format: Nat [(If_name)] nat_id local_ip [netmask [Max_conns [Em_limit]]], where If_name is the interface name; na
Configure NIC IP alias under Linux
What is an IP alias (IP alias).
In the words of Windows, it is to configure multiple IP for a network card.
Where to add IP aliases can be useful.
Network requirements, multiple IP access testing, specific software needs for multiple IP ... and so on.
Here are a few examples of how to use the Ifconfig command to configure an IP alias for a network adapter.
Environment: Newly purchased server, just installed Redhat AS4 operating system, only a network card and
Linux Basic network SettingsBasic information of network, setting up basic information of network; DHCP Automatic management network basic information1. View of the basic information of the network:Ip/netmask/gateway/dns/mac/hostname/hosts Network basic information1) View ip/netmask/mac information: IFCONFIG/IPIFCONFIG-A # #查看所有激活与非激活的网卡信息Ifconfig # #只查看激活的网卡信息Ifconfig eth0 # #查看单个网卡信息IP A # #查看ip地址等信息IP L
network-related settings.Typically include the following: hostname ip/netmask routing: Default gateway DNS Server primary DNS server secondary DNS server third DNS serverInterface Naming method:View Nic: Dmesg |grep–i ETH ethtool-i eth0 offload NIC driver: modprobe-r e1000 rmmod e1000 load NIC driver: Modprobe e10002.1, Network configuration modeStatic designations: ifconfig, route, netstat ip:object {link, addr, route}, SS, TC System-config-network-
network interface, which is a very common tool. For example, we can use this tool to configure the network card IP address, MAC address, mask, broadcast address and so on. It is worth saying that you use Ifconfig to specify the IP address for the network adapter, which is only used for debugging networks, and does not change the system configuration file on the NIC. If you want to fix the IP address of the network interface, there are currently three methods: one is to modify the IP address thr
Linux Network attribute configuration is divided into two typesStatically specified
by command: Ifcfg:ifconfig,route,netstat
Ip:object {link, addr, route}, SS, TC
You can also specify through a configuration file: System-config-network-tui
In addition, a new set of commands was added to CentOS 7: nmcli, Nmtui
Dynamic allocation
Dhcp
Here's how to use each command
Ifcfg
Ifconfig commandIfconfig [Interface]# Ifconfig–a View All interface status
650)
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.