Guest User

Untitled

a guest
Nov 18th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. # The loopback network interface
  2. auto lo
  3. iface lo inet loopback
  4.  
  5. # Network A
  6. allow-hotplug eth0
  7. iface eth0 inet static
  8. address 10.1.10.100
  9. netmask 255.255.255.0
  10. gateway 10.1.10.1
  11.  
  12. # Network B
  13. allow-hotplug eth1
  14. iface eth1 inet static
  15. address 192.168.100.1
  16. netmask 255.255.0.0
  17. gateway 127.0.0.1
  18.  
  19. ip route add 192.168.50.0/24 via 10.1.10.100 dev eth0
  20. # This command makes things happy...
  21.  
  22. $ ip route show
  23. default via 10.40.16.1 dev eth0
  24. 10.1.10.0/24 dev eth0 proto kernel scope link src 10.1.10.100
  25. 192.168.0.0/16 dev eth1 proto kernel scope link src 192.168.100.1
  26. 192.168.50.0/24 via 10.1.10.100 dev eth0
  27.  
  28. #/etc/network/interfaces
  29.  
  30. # Network A
  31. allow-hotplug eth0
  32. iface eth0 inet static
  33. address 10.1.10.100
  34. netmask 255.255.255.0
  35. gateway 10.1.10.1
  36. post-up route add -net 192.168.50.0 netmask 255.255.255.0 eth0
  37. post-down route del -net 192.168.50.0 netmask 255.255.255.0 eth0
  38.  
  39. # Network B
  40. allow-hotplug eth1
  41. iface eth1 inet static
  42. address 192.168.100.1
  43. netmask 255.255.0.0
  44. gateway 127.0.0.1
  45.  
  46. allow-hotplug eth0
  47. iface eth0 inet static
  48. address 10.1.10.100
  49. netmask 255.255.255.0
  50. gateway 10.1.10.1
  51. up ip route add 192.168.50.0/24 via 10.1.10.100 dev eth0
Add Comment
Please, Sign In to add comment