---------------------------- Network-related articles --------------------------
0001 change Apache's default character set to Chinese (bjchenxu)
VI httpd. conf, find adddefaultcharset ISO-8859-1 line
For Apache version 1. *, change to adddefacharcharset gb2312.
If it is 2. *, change to adddefacharcharset off.
Run/etc/init. d/httpd restart and restart Apache.
0002 permanent IP address change (bjchenxu)
Ifconfig eth0 new IP
Then edit/etc/sysconfig/network-scripts/ifcfg-eth0 and modify the IP
0003 remote display of Windows desktop (lnx3000) on Linux)
Install rdesktop package
0004 manually add the Default Gateway (bjchenxu)
Run the following command as the root user: Route add default GW gateway IP Address:
Want to change gateway
1 VI/etc/sysconfig/network-scripts/ifcfg-eth0
Change Gateway
2/etc/init. d/network restart
0005 RedHat 8.0 on MSN and QQ (bjchenxu)
Download Gaim 0.58:
Gaim-0.58-2.i386.rpm
Download QQ plug-in for gcc2.9:
Libqq-0.0.3-ft-0.58-gcc296.so.gz
Put the downloaded file in the/TEMP directory, and then delete the existing Gaim in the system. That is, in the terminal simulator, type the command: rpm-e Gaim.
Start Installation
Open the terminal simulator and run the following command to install Gaim 0.58:
CD/temp (go to the temp directory)
Rpm-IVH gaim-0.58-2.i386.rpm (software installation)
After the installation is successful, you can create a Gaim icon on the gnome or KDE Desktop.
To continue to install the QQ plug-in, enter the following command:
Gunzip libqq-0.0.3-ft-0.58-gcc296.so.gz (Extract files)
CP libqq-0.0.3-ft-0.58-gcc296.so/usr/lib/Gaim (copy the plug-in to the Gaim library directory)
Software settings
The logon interface that appears when Gaim 0.85 is started for the first time. Select plug-in first, click load in the plug-in dialog box, load libmsn. So and libqq-0.0.3-ft-0.58-gcc296.so files respectively, confirm and close. Then select "all accounts" and click "add" in the account editor that appears. When the Account Modification page appears, we can enter our QQ or MSN number, enter the QQ number or MSN mailbox for the login name, enter the corresponding QQ or MSN password for the password, enter your nickname for alias, select the corresponding QQ or MSN protocol, and set other settings to the default one. After all the settings are complete, you can log on and use them.
Due to frequent upgrades to the MSN protocol by MS, the Gaim and MSN plug-ins on Linux must be upgraded. Currently, there is no foolproof solution. Sorry.
0006 find out the program running on port 22 (bjchenxu)
Lsof-I: 22
0007 view the local IP address, gateway, and DNS (bjchenxu)
IP:
Log on as the root user and execute ifconfig. Eth0 is the first Nic, and lo is the default device.
Gateway:
Log on as a root user and run netstat-Rn. the gateway of a row starting with 0.0.0.0 is the default gateway.
You can also view the/etc/sysconfig/network file, which contains the specified address!
DNS:
More/etc/resolv. conf:
Nameserver 202.96.69.38
Nameserver 202.96.64.38
0008 run the rh8.0 command line to change the ping TTL value (cgweb, lnx)
Method 1 (valid after restart ):
# Sysctl-W net. ipv4.ip _ default_ttl = N
(N = 0 ~ 255). If n> 255, TTL = 0
Method 2 (invalid after restart ):
# Echo n (n is 0 ~ (255)>/proc/sys/NET/IPv4/ip_default_ttl
0009 enable Linux IP Forwarding (houaq)
Edit/etc/sysctl. conf. For example, Set
Net. ipv4.ip _ forward = 0
Change
Net. ipv4.ip _ forward = 1
It takes effect after restart. Use sysctl-a to view details.
0010 mount the directory shared by other Windows machines on the LAN (bjchenxu)
Mount-T smbfs-O username = guest, password = guest // machine/path/mnt/CDROM
0011 allowed | Prohibit root login via SSH (fun-FreeBSD)
Modify sshd_config: permitrootlogin no | Yes
0012 allow root to directly telnet to log on (bjchenxu, platinum)
Method 1:
Edit/etc/PAM. d/login and remove
Auth required/lib/security/pam_securetty.so
Method 2:
VI/etc/securetty
Add
PTS/0
PTS/1
...
0013 connect to the ADSL device in Linux (wind521)
A Linux + at least one network card + broadband device that runs normally has been applied for and has been activated. There are several kinds of ADSL devices on the market, and there are some slight differences in the way they work.
The process of using virtual dialing to access the Internet, that is, using pppoe devices to perform virtual dialing is called an omnidirectional cat, which is a kind of automatic dialing after power-on, the interfaces left for us are RJ45, while the gateways left for us in Dalian are 10.0.0.2. This kind of device is the easiest to deal with, and finally it is to directly assign a fixed IP address to the user, relatively easy to deal
1. The first type requires Dialing:
These devices communicate with computers through the ETH interface, so connect the hardware devices first, especially those of broadband cats, be sure to make sure it is correct (otherwise it will not be my business if you want to do it later)
Then start the system and check whether the RP-pppoe software is installed on the system (search by rpm-Qa | grep pppoe). If no user is installed, go down one on the CD or on the Internet. After installation, run the ADSL-setup command as the root user to enter the configuration status of the ADSL data, you need to enter the user name and other information for applying for broadband, confirm that there is no problem, accept until the end (which is all e-text, but can understand at first glance, relatively simple, related to a firewall settings, I generally don't need to use it. Select 0. You can take it into consideration ).
After the configuration is complete, run the ADSL-start command as the root user. The ADSL dial-up will be launched normally. If you have any specific problems, let's take a look at what the log (/var/log/messages) tells you.
Stop ADSL and execute ADSL-stop (very simple)
2. The other two methods are easier to deal:
Omnidirectional Cat: as long as you set the IP address of your network card to a 10-segment IP address, and then the gateway points to the IP address of the omnidirectional CAT (10.0.0.2), there is basically no big problem.
Fixed IP Address: Just like configuring a local Nic, you can fill in the IP address, gateway, and DNS according to the application.
0014 set the Linux automatic synchronization time (shunz)
VI/etc/crontab
Add the following sentence:
00 0 1 ** root rdate-s time.nist.gov
0015 Linux Online Resources (bjchenxu)
Foreign
Http://lwn.net/
Http://www.tldp.org/
Http://www.yolinux.com/(flying-dance big pig)
Http://www.justlinux.com/
Http://www.linuxtoday.com/
Http://www.linuxquestions.org/
Http://www.fokus.gmd.de/linux/
Http://www.linux-tutorial.info/
Http://public.www.planetmirror.com/
Http://www.freebsdforums.org/forums/
Http://www.netfilter.org/documentation/
Http://www-106.ibm.com/developerworks/linux/
China
Http://www.fanqiang.com/
Http://www.linuxsir.com/
Http://www.chinaunix.net/
The http://www.linuxfans.org/(deadcat)
Http://www.linuxeden.com/
Http://www.linuxforum.net/
Http://www.linuxaid.com.cn/
Http://freesoft.online.sh.cn/
Http://www-900.ibm.com/developerWorks/cn/linux/index.shtml
Http://www.neweasier.com/software.html
Http://www.blueidea.com/bbs/archivecontent.asp? Id = 635906 (SQH)
The http://westlinux.ywzc.net/(OneSun)
0016 change the sshd port (bjchenxu)
Add a line in/etc/ssh/sshd_config: Port 2222,/etc/init. d/sshd restart to restart the daemon process.
0017 change the telnet port (bjchenxu)
Change the port number 21 corresponding to telnet in the/etc/services file to the value you want, and restart the daemon process in/etc/init. d/xinetd restart.
0018 problems with the terminal mode (sakulagi)
Export term = VT100
0019 simulate a Super Terminal. in Linux, what programs are connected to routers and switches (alstone)
Minicom
0020 SSH connection failure (wind521, dual eyelid pig)
Modify the. bash_profile file in the home directory, and add
Export tmout = 1000000 (in seconds)
Then run source. bash_profile
0021 what tools are used for intrusion detection (bjchenxu)
Snort
0022 Linux bjchenxu)
Both cchecker and efence databases are supported.
0023 how to monitor all data through the local Nic in Linux (bjchenxu)
Tcpdump or iptraf
0024 why does the root user say "command not found (bjchenxu)" When executing many commands)
You are using telnet, And Then Su is root. Change the su command format to Su-root.
0025 disable the POP3 permission of a user (tiansgx)
You can turn off the POP3 port. Find the pop-3 110/tcp line in the file/etc/services and add '#' to the front of the line to comment it out.
0026 play Flash Animation (myxfc) in Linux)
Playing Flash Animation in Linux will not close the browser (Other plug-ins are not easy to use)
First download the Flash Player Plug-in Linux
Http://www.collaborium.org/onsite/jos2000/related/soft/flash_linux.tar.gz
Tar zxvf flash_linux.tar.gz
After opening the package, you will see the Linux folder
In the Linux File cheek, there are two files libflashplayer. So and shockwaveflash. Class. Copy these two files to the plug-ins in your browser (different browsers may have different plug-ins in different locations)
/Usr/lib/mozilla-1.0.1/plugins, you can
0027 lock the Wu-FTP user directory (wangla)
Edit the ftpaccess File
Restricted-UID *
This sentence is very important, which limits ftp users to be in their own directories.
0028 how does the server not allow Telnet (Zhiqiu yiye)
The Telnet Service and the firewall priority of the server must be set to low.
0029 prevent anyone from using the su command as root (xiaohu0)
1. VI/etc/PAM. d/su
Auth sufficient/lib/security/pam_rootok.so debug
Auth required/lib/security/pam_wheel.so group = wheel
2. Define the wheel group in the/etc/PAM. d/su configuration file.
0030 how to enable the lynx browser to browse Chinese web pages (ghost_vale)
Modify the following settings when you browse the Simplified Chinese web page:
Save options to disk: [x]
Display and Character Set
Display character set: [Chinese ________________________]
Assumed document character set (!) : [Iso-8859-1 ______]
CJK mode (!) : [On _]
Move to the bottom accept changes and press enter to save it.
Of course, your system must support simplified Chinese.
0031 What should I do if the NIC is activated but cannot access the network? (Slock, dual eyelid pig)
Traceroute: Check whether the block is blocked.
1. Ping yourself
2. Ping the Gateway
3. Ping DNS
4. traceroute DNS
If everything is normal
NSLookup www.sina.com.cn
Ping Sina's address
Traceroute Sina's address
Basically, you can know the result.
0032 if Samba is configured in redhat9, can Win2000 access and Win98 access? (Squall2003)
If it is wind98, you must modify the Registry: HKEY_LOCAL_MACHINE/system/ententcontrolset/services/VxD/vnetsup to create a D value: enableplaintextpasswd, key value 1
0033 how to obtain the MAC address of the NIC (bjchenxu, huhuuworm)
ARP-A | awk '{print $4 }'
Ifconfig eth0 | head-1 | awk '{print $5 }'
0034 how to obtain the IP address of the NIC (MB)
Ifconfig eth0 | awk '/inet ADDR/{split ($2, X, ":"); print X [2]}'
0035 how to modify the Working Group of the Linux machine (huhuuworm)
VI/etc/samba/smb. conf, modify workgroup = a row, and write the group name behind it.
0036 how to bind two IP addresses to a network card (linuxloveu)
# Cd/etc/sysconfig/network-Scripts
# Cp ifcfg-eth0 ifcfg-eth0: 1
# Vi ifcfg-eth0: 1
Modify IP address and device name
Debian Method for binding multiple IP addresses to the next NIC (netdc)
Modify/etc/Network/interfaces
Auto eth0
Iface eth0 Inet static
Address 172.16.3.123
Netmask 255.255.255.0
Network 172.16.3.0
Broadcast 172.16.3.255
Gateway 172.16.3.1
Auto eth0: 1
Iface eth0: 1 Inet static
Address 10.16.3.123
Netmask 255.255.0.0
Network 10.16.0.0
Broadcast 10.16.0000255
Modify/etc/Network/ifstate
Lo = Lo
Eth0 = eth0
Eth0: 1 = eth0: 1
Then/etc/init. d/networking restart.
One method for binding multiple IP addresses to one NIC (hotbox)
Create a file under/etc/sysconfig/network-scripts/: ifcfg-ethx-rangex ("X" indicates the nic id)
File Content:
Ipaddr_start = <start ip>
Ipaddr_end = <End ip>
Clonenum = 0
There can be 256 IP addresses
0037 how to bind an IP address to two NICs)
Suppose 192.168.0.88 is an IP address and 192.168.0.1 is a gateway:
/Sbin/modprobe bonding miimon = 100 mode = 1
/Sbin/ifdown eth0
/Sbin/ifdown eth1
/Sbin/ifconfig bond0 192.168.0.88
/Sbin/ifenslave bond0 eth0 eth1
/Sbin/route add default GW 192.168.0.1
0038 192.168.1.0/24 (dual eyelid pig)
It is equivalent to 192.168.1.0/255.255.255.0, but the representation method is different ....
0039 Linux Command for clearing ARP tables (netdc)
# ARP-D-A (applicable to BSD)
For host in 'Arp | sed '/address/d' | awk' {print $1} ''; do ARP-d $ host; done
0040 use NTP protocol to synchronize time from the server (netdc)
Ntpdate NTP-SERVER example: ntpdate 172.16.2.1
0041 use of the Host Command (bjchenxu)
The host can be used to query the domain name and obtain more information.
Host-t mx example.com can be used to query the MX record of example.com and the host name for processing mail.
Host-l example.com will return all domain names registered under example.com
Host-A example.com will display all Domain Name Information of this host.
0042 immediately enable Linux to support NAT (platinum)
Echo 1>/proc/sys/NET/IPv4/ip_forward
Iptables-T nat-I postrouting-J Masquerade
0043 setting RCP usage in rh8.0 (zhqh1)
Effective only for root users
1. Create the. rhosts file under the root directory of both root users, and add the hostnames of both parties. Prior to this, add the IP address and hostname of the other party to the/etc/hosts file of both parties.
2. Start the RSH service. RedHat is disabled by default. Method: run the ntsysv command, select it with the Space key before the RSH option, and then exit. Run service xinetd restart.
3. In the/etc/PAM. d/directory, use "#" to block the auth required/lib/security/pam_securetty.so line in the RSH file.
0044 on the ethx device, enable Linux to support the network broadcast function (not supported by default) (platinum)
IP Route add route 255.255 Dev ethx
0045 route settings Manual (netdc)
View route information:
Netstat-Rn
Route-n
Manually add a route entry:
Route add-net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Manually delete a route entry:
Route del-net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Now, let's make it important to enable route settings automatically when the system starts.
Add a route entry to RedHat and modify the/etc/sysconfig/static-routes file.
Any net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Add a route entry to Debian,
Method 1: Modify/etc/Network/interfaces
Code:
Auto eth0
Iface eth0 Inet static
Address 172.16.3.222
Netmask 255.255.0.0
Network 172.16.0.0
Broadcast 172.16.0000255
Gateway 172.16.2.1
Up Route add-net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Down Route del-net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Method 2: create a simple script file under the/etc/Network/if-up.d directory, such as static-route $ (remember to end with the $ symbol, otherwise, a run-parts will run to tell you something.) The script is the simplest, for example:
Code:
#! /Bin/bash
Route add-net 192.168.0.0 netmask 255.255.255.0 GW 172.16.0.1
Hey, you can also guess the role of other directories under the/etc/Network/directory.
I found that in Debian, this route setting is only a simple application of its configuration files. You can do more complex applications.
0046 use SSH to copy a file (platinum)
Assume that both A and B have the SSH service.
1. Copy B from a (pushed over)
SCP-RP/path/filename username @ remoteip:/path
2. copy from B to a (pull)
SCP-RP username @ remoteip:/path/filename/path
If one of them is not a Linux system, you can use securefx on Windows.
0047 solution to samba3.0 Chinese display problem (linuxzfp)
Add the following two sentences to [Global] in the configuration file/usr/samba/smb. conf of Samba 3.0:
DOS charset = cp936
UNIX charset = cp936
Restart service
/Etc/init. d/SMB restart
0048 how to temporarily modify the MAC address of the NIC
Disable NIC:/sbin/ifconfig eth0 down
Then change the address:/sbin/ifconfig eth0 HW ether 00: AA: BB: CCD: EE.
Then start the NIC:/sbin/ifconfig eth0 up
0049 how to handle full conntrack tables (cgweb)
The proxy server configured by iptables + squid has been working normally. I found on the console today
Jun 18 12:43:36 red-Hat kernel: ip_conntrack: Table full, dropping packet.
Jun 18 12:49:51 red-Hat kernel: ip_conntrack: Table full, dropping packet.
Jun 18 12:50:57 red-Hat kernel: ip_conntrack: Table full, dropping packet.
Jun 18 12:57:38 red-Hat kernel: ip_conntrack: Table full, dropping packet.
Ip_conntrack indicates the connection to the tracking database (conntrack database). It indicates the number of NAT machine trace connections. The number of records that the connection tracking table can accommodate is controlled by a variable, it can be set by the IP-sysctl function in the kernel. Each trace connection table occupies 350 bytes of kernel storage space. After a long time, the default space will be filled up. What is the default space? Taking Redhat as an example, when the memory is 64 Mb on a machine, the memory is 4096, the memory is 8192, and the memory is 16376, then you can view and set it in/proc/sys/NET/IPv4/ip_conntrack_max.
For example, to increase to 81920, run the following command:
Echo "81920">/proc/sys/NET/IPv4/ip_conntrack_max
In this way, the settings will not be saved. To save the settings after restart, you can add the following in/etc/sysctl. conf:
Net. ipv4.ip _ conntract_max = 81920
After this method is changed, everything is normal. If it is full, you can increase the value.
0050 how to use BT (atz0001) in Linux)
Azureus, http://azureus.sourceforge.net/
0051 view the working mode of the optical fiber Nic in Linux (sakulagi)
Insert a 64-bit fiber Nic into the PCI-X slot on the motherboard. In the Linux9.0 environment, you need to know if it works in 64-Bit mode, you can use getconf word_bit