Linux router configuration instance
Release Date: 2002-06-06
Abstract:
Welfare: cold wind
http://www.chinalin ketub.com
Task: Configure the router using the Linux server.
Objective: Two network segments in the unit: 192.168.1.0/24 and 192.168.2.0/24 two network segments are interviewed with each other.
step:
1. Install a two-network card machine
2. Set the address of the ETH0 to 192.160.1.254, and the address of Eth1 is set to 192.168.2.254:
# ifconfig eth0 192.168.1.254 Broadcast 192.168.1.255 Netmask 255.255.255.0
# ifconfig eth1 192.168.2.254 Broadcast 192.168.2.255 Netmask 255.255.255.0
3. Add routing information:
#Route Add -Net 192.168.1.0 Netmask 255.255.255.0 Dev Eth0
# Route Add -Net 192.168.2.0 Netmask 255.255.255.0 Dev Eth1
4. Set all the host default gateways in the 192.168.1.0/24 network segment to 192.168.1.254, set the default gateway of all hosts in the 192.168.2.0/24 network segment to 192.168.2.254
5. Test