How to add routes to the ip tables to see other subnets?
How to add routes to the ip tables to see other subnets?
If i have one server with a static ip, example (192.168.1.x) if i want to connect this server to one switch in one Site with others servrs and router and switches, and these devices had another subnets, like 192.168.2,3,4,5. How to add the routes in the CentOS server to ping these devices?
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: How to add routes to the ip tables to see other subnets?
You need routers.
Re: How to add routes to the ip tables to see other subnets?
You can add routes per interface by creating e.g /etc/sysconfig/network-scripts/route-eth0 (name varies according to interface name). The contents are the portion of e.g ip route add 10.0.0.0/8 via 172.16.1.1 but minus the "ip route add".
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: How to add routes to the ip tables to see other subnets?
172.16.1.1 is the example of mi ip server dont you?, and this is for each network that i want to go?
Re: How to add routes to the ip tables to see other subnets?
Yes, that was example that said, "any traffic destined host any hosts on 10.0.0.0/8 should be sent to the router 172.16.1.1". Neither of them would be your server IP, the first is the subnet you want to send a different route than the default, the IP address is the router than can send the traffic there for you.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: How to add routes to the ip tables to see other subnets?
Sorry for the soo late answer, i was in vacations :c, so, if i want to add more subnets i need to create another file or just another line?, suppossing that i only used one network card (eth0)
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: How to add routes to the ip tables to see other subnets?
If you only have one NIC and one router, just define the default GATEWAY in /etc/sysconfig/network.
If you have multiple routers to different networks, define those routes as stated previously.
Please read the FAQ http://wiki.centos.org/FAQ/CentOS7
If you have multiple routers to different networks, define those routes as stated previously.
Please read the FAQ http://wiki.centos.org/FAQ/CentOS7