Post by ZF on Sept 9, 2015 21:42:57 GMT -5
Assuming the following setup:
[Internet] -- [ Router with DHCP ] -- [ Switch ] -- [ Clients ]
Target Setup:
[Internet] -- [ Router with DHCP ] -- [ MITM Ubuntu ] -- [ Switch ] -- [ Clients ]
NIC Configuration:
[Internet] -- [ Router with DHCP ] -- eth0 [ MITM Ubuntu ] eth1 -- [ Switch ] -- [ Clients ]
Following should be performed using root / sudo
Use Network Manager to assign static IP address to the eth1
IP address : 192.168.1.233
netmask : 255.255.255.0
gateway : 192.168.1.1
In this example, eth0 is on dhcp and have been assigned the ip address 192.168.1.234
eth1 is running a SEPARATE DHCP service for the downline clients
apt-get install isc-dhcp-server
Edit /etc/default/isc-dhcp-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1 eth2 eth3"
Edit /etc/dhcp/dhcpd.conf
//This will set the gateway for all clients connected to eth1 to use eth0 as the gateway
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.250;
option domain-name-servers 8.8.8.8;
option routers 192.168.1.234;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
echo 1 /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#sudo iptables -A FORWARD -i eth0 -o eth1 -m state -–state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables-save > /etc/iptables.rules
SOURCE:
www.yourownlinux.com/2013/07/how-to-configure-ubuntu-as-router.html
stackoverflow.com/questions/27816918/how-to-configure-multiple-nic-cards-on-ubuntu-server-14-04-lts-and-connect-to-ro
ubuntuforums.org/showthread.php?t=885664
askubuntu.com/questions/482143/how-to-configure-2-lan-cards
help.ubuntu.com/community/Internet/ConnectionSharing
[Internet] -- [ Router with DHCP ] -- [ Switch ] -- [ Clients ]
Target Setup:
[Internet] -- [ Router with DHCP ] -- [ MITM Ubuntu ] -- [ Switch ] -- [ Clients ]
NIC Configuration:
[Internet] -- [ Router with DHCP ] -- eth0 [ MITM Ubuntu ] eth1 -- [ Switch ] -- [ Clients ]
Following should be performed using root / sudo
Use Network Manager to assign static IP address to the eth1
IP address : 192.168.1.233
netmask : 255.255.255.0
gateway : 192.168.1.1
In this example, eth0 is on dhcp and have been assigned the ip address 192.168.1.234
eth1 is running a SEPARATE DHCP service for the downline clients
apt-get install isc-dhcp-server
Edit /etc/default/isc-dhcp-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth1 eth2 eth3"
Edit /etc/dhcp/dhcpd.conf
//This will set the gateway for all clients connected to eth1 to use eth0 as the gateway
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.250;
option domain-name-servers 8.8.8.8;
option routers 192.168.1.234;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
echo 1 /proc/sys/net/ipv4/ip_forward
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#sudo iptables -A FORWARD -i eth0 -o eth1 -m state -–state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables-save > /etc/iptables.rules
SOURCE:
www.yourownlinux.com/2013/07/how-to-configure-ubuntu-as-router.html
stackoverflow.com/questions/27816918/how-to-configure-multiple-nic-cards-on-ubuntu-server-14-04-lts-and-connect-to-ro
ubuntuforums.org/showthread.php?t=885664
askubuntu.com/questions/482143/how-to-configure-2-lan-cards
help.ubuntu.com/community/Internet/ConnectionSharing