-
-
Save awsvpc/c711b99d7ed97730f49cd4cdb871e75a to your computer and use it in GitHub Desktop.
Revisions
-
goffinet revised this gist
Mar 12, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,8 +15,8 @@ nmcli c up "$connection" sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1 sysctl -p echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf echo "net.ipv6.conf.all.forwarding=1" >> /etc/sysctl.conf } 3_firewall () { systemctl enable firewalld -
goffinet revised this gist
Mar 12, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,8 @@ nmcli c up "$connection" sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1 sysctl -p echo "net.ipv4.ip_forward=1" > /etc/sysctl.conf echo "net.ipv6.conf.all.forwarding=1" > /etc/sysctl.conf } 3_firewall () { systemctl enable firewalld -
goffinet revised this gist
Mar 11, 2017 . No changes.There are no files selected for viewing
-
goffinet revised this gist
Mar 11, 2017 . 1 changed file with 19 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,33 +1,42 @@ #!/bin/bash connection="System eth0" ip4="192.168.168" ip6="fd00:168:168" 1_interfaces () { hostnamectl set-hostname router nmcli c mod "$connection" ipv4.addresses $ip4.1/24 nmcli c mod "$connection" ipv4.method manual nmcli c mod "$connection" ipv6.addresses $ip6::1/64 nmcli c mod "$connection" ipv6.method manual nmcli c mod "$connection" connection.zone internal nmcli c up "$connection" } 2_routing () { sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1 sysctl -p } 3_firewall () { systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=internal --add-service=dns --permanent firewall-cmd --zone=internal --add-service=dhcp --permanent firewall-cmd --zone=internal --add-service=dhcpv6 --permanent firewall-cmd --zone=internal --add-source=${ip4}.0/24 --permanent firewall-cmd --zone=internal --add-source=${ip6}::/64 --permanent firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd --reload } 4_dhcp-dns () { yum -y install dnsmasq* echo "dhcp-range=$ip4.50,$ip4.150,255.255.255.0,12h" > /etc/dnsmasq.d/eth0.conf echo "dhcp-option=3,$ip4.1" >> /etc/dnsmasq.d/eth0.conf echo "dhcp-range=$ip6::2,$ip6::500,slaac" >> /etc/dnsmasq.d/eth0.conf systemctl enable dnsmasq systemctl start dnsmasq } 1_interfaces 2_routing 3_firewall 4_dhcp-dns -
goffinet revised this gist
Dec 22, 2016 . 1 changed file with 11 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,24 +1,33 @@ #!/bin/bash 1_interfaces-ipv4 () { hostnamectl set-hostname router nmcli c mod eth0 ipv4.addresses 192.168.168.1/24 nmcli c mod eth0 ipv4.method manual nmcli c mod eth0 connection.zone internal nmcli c up eth0 } 2_routing () { sysctl -w net.ipv4.ip_forward=1 sysctl -p } 3_firewall () { systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=internal --add-service=dns --permanent firewall-cmd --zone=internal --add-service=dhcp --permanent firewall-cmd --zone=internal --add-source=192.168.168.0/24 --permanent firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd --reload } 4_dhcp-dns () { yum -y install dnsmasq* echo "dhcp-range=192.168.168.50,192.168.168.150,255.255.255.0,12h" > /etc/dnsmasq.d/eth0.conf echo "dhcp-option=3,192.168.168.1" >> /etc/dnsmasq.d/eth0.conf systemctl enable dnsmasq systemctl start dnsmasq } 1_interfaces-ipv4 2_routing 3_firewall 4_dhcp-dns -
goffinet created this gist
Dec 18, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/bash main () { hostnamectl set-hostname router nmcli c mod eth0 ipv4.addresses 192.168.168.1/24 nmcli c mod eth0 ipv4.method manual nmcli c mod eth0 connection.zone internal nmcli c up eth0 sysctl -w net.ipv4.ip_forward=1 sysctl -p systemctl enable firewalld systemctl start firewalld firewall-cmd --zone=internal --add-service=dns --permanent firewall-cmd --zone=internal --add-service=dhcp --permanent firewall-cmd --zone=internal --add-source=192.168.168.0/24 --permanent firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd --reload yum -y install dnsmasq* echo "dhcp-range=192.168.168.50,192.168.168.150,255.255.255.0,12h" > /etc/dnsmasq.d/eth0.conf echo "dhcp-option=3,192.168.168.1" >> /etc/dnsmasq.d/eth0.conf systemctl enable dnsmasq systemctl start dnsmasq } main