Upload
bernard-mccormick
View
216
Download
0
Embed Size (px)
Citation preview
Linux Routing
Why use Linux as a router?
Its cheap.Linux has low hardware requirements. A properly configured P166 Mhz computer would have no problems routing for a T1 or cable/DSL connection.
How do I setup a router?
Firstly you have to insure that your kernel has recognized each of your network cards. This can be done by typing ifconfigIE) ifconfig eth0
ifconfig eth1ifconfig eth
What if my cards are not recognized by the kernel?
You will then have to recompile your kernel or edit the rc.modules file.The rc.modules file simply runs during boot up and runs the modprobe command to search for compile modules. You should just have to uncomment the modules you wish to run.
A Sample Network
199.166.133.2 193.1.1.3 193.1.1.2
ppp0 ppp0 ppp1 eth0
eth0
eth0 eth0 eth0
dog pig
horse
Internet
bear elk beaver
otter
hog
eth0 eth0 eth0
200.1.2.1
200.1.2.2 200.1.2.3 200.1.2.4
222.100.3.8 222.100.3.6 222.100.3.3
222.100.3.1
199.166.133.1
Review of networking Step 1
Identify the default routes for each of the routers.PigDogHogHorseOtterBearElkBeaver
Review of networking Step 2
Identify each of the routes for each of the routers. Identify the interfacesWrite the route command for each of the routes.
Adding a route
To add a route to a network one would use the route command.
To View Routing Tables one could use the netstat –rn command or the route command.
Adding/Deleting Network Routes
route add -net 10.10.10.0/24 gw 192.168.0.1
route del -net 10.10.10.0/24 gw 192.168.0.1
Adding/Deleting Host Routes
Adding and Removing a specific host in Linux
route add -host 10.10.10.45 gw 192.168.0.1route del -host 10.10.10.45 gw 192.168.0.1
Adding/Deleting Default gateways
route add default gw 192.168.0.1route del default gw 192.168.0.1