In Debian linux, i need to add some IP specific routing config. I have a default route for internet, and have other gateway for other services to access.
So i need to be able make the routing configuration is injected when the network services loaded.
How to do this are, in your /etc/network/interfaces add this :
auto eth0
iface eth0 inet static
hwaddress 00:1b:24:b0:b7:8f
address 192.168.113.109
netmask 255.255.255.0
broadcast 192.168.113.255
gateway 192.168.113.224
up route add -net 172.16.0.0 netmask 255.255.0.0 gw 192.168.113.204
up route add -net 172.30.0.0 netmask 255.255.0.0 gw 192.168.113.205
up route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.113.206
up route add -net 10.0.0.0 netmask 255.255.0.0 gw 192.168.113.104
So the result are like this :
Default traffic going to 192.168.113.224 , and traffic going to network 172.16.x.x going through gateway 192.168.113.204 , and same rule apply to the next network destination.
You can add more route according your needs.
0 comments:
Post a Comment