Hi,
This is basically a question about what --static-routes can do for me.
Suppose I wanted to configure this sort of thing on a new machine:
http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes...
Specifically, I'm currently booting a CentOS6 virtual machine (on a VMware ESXi 4 hypervisor), which has two NICs:
- eth0 on 192.168.114.0/24 (a private network, with a gateway to the internet) - eth1 on 123.456.789.0/24 (a direct connection to the internet)
The idea being that the machine is provisioned using Cobbler over the private network, but is then set up to be directly connected to the internet via eth1 (and indirectly connected via eth0). This also potentially means I could put other sensitive infrastructure on the private network.
(I realise another method could be to use NAT or a reverse-proxy to map external public addresses to internal ones, and give the virtual machine only one NIC; I'm trying to decide which is better.)
Given a profile which uses a more-or-less standard Cobbler kickstart config, and a Cobbler server on the private network at 192.168.114.1 which acts also as a DHCP, caching DNS, and gateway server, my initial guess was that it might involve creating a "system" definition something like this:
cobbler system edit --name=server1 \ --profile=el6.x86.esx4.puppet \ --hostname=server1.mydomain.net \ \ --interface=eth0 \ --static=0 \ --ip=192.168.114.52 --mac=xx:xx:xx:xx \ --dns-name=server1.mydomain.net
cobbler system edit --name=server1 \ --interface=eth1 \ --static=1 \ --static-gateway=???? \ --ip=123.456.789.100 --mac=yy:yy:yy:yy
Except I'm not sure what the static gateway option would be. The documentation for --static-gateway simply says:
This is a space delimited list of ip/mask:gateway routing information
Which makes me think it can't configure something like the following:
ip route add 192.168.114.0/24 dev eth0 src 192.168.114.52 table admin ip route add default via 192.168.114.1 dev eth0 table admin
ip rule add from 192.168.114.52/32 table admin ip rule add to 192.168.114.52/32 table admin
This would (I think) allow traffic coming from eth0 to go back out on eth0, and other traffic to go back out eth1 - assuming the main default gateway was set to via 123.456.789.1.
If I'm right and --static-routes isn't capable of this, presumably I need to write a post_install snippet which writes into /etc/iproute2/rt_table and /etc/sysconfig/network-scripts/route-eth0. The net result I want to achieve being similar to what was described here:
http://lists.centos.org/pipermail/centos/2011-January/105072.html
Thanks,
Nick
cobbler@lists.fedorahosted.org