Thursday, February 23, 2017

Connection sharing on two NICs

internet access on enp0s10, shared on enp1s7 and enp1s6

/etc/dhcpd.conf:

subnet 192.168.1.0 netmask 255.255.255.0 {
        # default gateway
        option routers 192.168.1.1;
        option subnet-mask 255.255.255.0;

        range dynamic-bootp 192.168.1.2 192.168.1.253;
        default-lease-time 21600;
        max-lease-time 43200;
}

subnet 192.168.2.0 netmask 255.255.255.0 {
        # default gateway
        option routers 192.168.2.1;
        option subnet-mask 255.255.255.0;

        range dynamic-bootp 192.168.2.2 192.168.2.253;
        default-lease-time 21600;
        max-lease-time 43200;
}

/etc/sysconfig/dhcpd:

OPTIONS="-q"
INTERFACES="enp1s7 enp1s6"

/etc/shorewall/masq:

enp0s10 192.168.1.0/24
enp0s10 192.168.2.0/24

No comments: