ovs-ofctl add-flow br0 "ip,nw_dst=192.168.1.100,actions=mod_nw_dst:10.0.0.200,normal" | Issue | Likely cause | Fix | |--------|---------------|------| | Map disappears after reboot | Not persistent | Use /etc/ethers + arp -f (Linux) or write config (Cisco write memory ) | | IP map not working | ARP cache timeout | Set static entry with nud permanent or increase ARP timeout | | Ansible map('ipaddr') fails | Missing ipaddr filter | Install ansible.utils collection | | NAT mapping no traffic | Reverse path filter | Check rp_filter or add return SNAT/DNAT rule | 7. Quick Reference CLI Examples | Use case | Command | |----------|---------| | Static ARP (Linux) | ip neigh add 192.168.1.10 dev eth0 lladdr 00:11:22:33:44:55 nud permanent | | Static ARP (Cisco) | arp 192.168.1.10 0011.2233.4455 ARPA | | DHCP reservation (Linux – dnsmasq) | dhcp-host=00:11:22:33:44:55,192.168.1.10 | | DNAT (port forward example) | iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.10:80 | Would you like a deeper example for any of these environments (e.g., Ansible playbook, iptables persistence, or Cisco router config)?
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j SNAT --to-source 203.0.113.10 map ip
arp 192.168.1.100 aabb.ccdd.eeff ARPA Or DHCP static binding: ovs-ofctl add-flow br0 "ip,nw_dst=192
Here’s a concise, practical guide for — typically found in network automation (like Ansible), SDN, or certain CLI-based network devices (e.g., Cisco, Huawei, or Linux bridging contexts). iptables -t nat -L -n -v Extract IPs
iptables -t nat -L -n -v Extract IPs from a list:
- name: Show IP mappings hosts: localhost vars: interfaces: - name: eth0 ips: ['192.168.1.10/24', '10.0.0.5/8'] - name: eth1 ips: ['172.16.1.1/24'] tasks: - debug: msg: " flatten " ["192.168.1.10", "10.0.0.5", "172.16.1.1"] 5. Scenario D: SDN / OpenFlow IP Mapping (e.g., Open vSwitch) Match IP and rewrite destination:
sudo ip neigh add 192.168.1.100 lladdr aa:bb:cc:dd:ee:ff dev eth0 nud permanent Check mapping: