11
Linux Routing

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

Embed Size (px)

Citation preview

Page 1: 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

Linux Routing

Page 2: 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

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.

Page 3: 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

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

Page 4: 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

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.

Page 5: 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

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

Page 6: 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

Review of networking Step 1

Identify the default routes for each of the routers.PigDogHogHorseOtterBearElkBeaver

Page 7: 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

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.

Page 8: 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

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.

Page 9: 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

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

Page 10: 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

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

Page 11: 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

Adding/Deleting Default gateways

route add default gw 192.168.0.1route del default gw 192.168.0.1