Set iptables rules for each IP, not just each interface

(imported from commit c24d2123489dc384bf50e379d245807af3488ebf)
This commit is contained in:
Luke Faraone 2013-12-12 16:15:19 -05:00
parent 9329109391
commit 104c2a06ae

View File

@ -91,6 +91,9 @@ for device in macs.values():
device = "eth%i:%i" % (device_number, count)
log.info("Configuring %s with IP %s" % (device, ip))
subprocess.check_call(['/sbin/ifconfig', device, ip])
subprocess.check_call(
['/sbin/iptables', '-t', 'mangle', '-A', 'OUTPUT', '-m', 'conntrack', '--ctorigdst',
ip, '-j', 'MARK', '--set-mark', str(device_number)])
for throwaway in range(2):
# Don't freak out if this doens't work.