In UNIX for example, you would change file /etc/rc. # You can automatically start SAProuter when you start the system. The content of this script, has the following sintaxes: # 'usr/sap/saprouter/saprouter_start: line 12: ` | tee -a $LOGFILE & usr/sap/saprouter/saprouter_start: line 12: syntax error near unexpected token `|' The problem is when I run the script that starts the saprouter service, it show me the following error: sap]# saprouter]# saprouter_start
![linux router configuration linux router configuration](https://linuxtiwary.files.wordpress.com/2015/03/staic-routing-using-serial-port.png)
Note: Please share your experiences and comments about this post.I´m trying to setup the saprouter on Fedora v14 (32 bits). If everything goes according to the above given instructions your router/gateway is ready to be used by your users in your local network. Now you can test by opening a page in internet explorer that your Linux router/gateway for internet connection sharing is working or not. Only connections defined above are allowed.Ģ6) alter the Linux kernel config file: /etc/nf Or you can configure your own DNS server on this LINUX machine I will try to explain that in a later post.Ĭonfigure the firewall to control the security.įirst flush everything and then allow limited ports and IP Addressesġ3) iptables -A INPUT -i lo -p all -j ACCEPT – Allow self access by loopback interfaceġ4) iptables -A OUTPUT -o lo -p all -j ACCEPTġ5) iptables -A INPUT -i eth0 -m state –state ESTABLISHED,RELATED -j ACCEPT – Accept established connectionsġ6) iptables -A INPUT -p tcp –tcp-option ! 2 -j REJECT –reject-with tcp-resetġ7) iptables -A INPUT -p tcp -i eth0 –dport 21 -j ACCEPT – Open ftp portġ8) iptables -A INPUT -p udp -i eth0 –dport 21 -j ACCEPTġ9) iptables -A INPUT -p tcp -i eth0 –dport 22 -j ACCEPT – Open secure shell portĢ0) iptables -A INPUT -p udp -i eth0 –dport 22 -j ACCEPTĢ1) iptables -A INPUT -p tcp -i eth0 –dport 80 -j ACCEPT – Open HTTP portĢ2) iptables -A INPUT -p udp -i eth0 –dport 80 -j ACCEPTĢ3) iptables -A INPUT -p tcp –syn -s 192.168.1.0/24 –destination-port 139 -j ACCEPT – Accept local network Samba connectionĢ4) iptables -A INPUT -p tcp –syn -s trancas –destination-port 139 -j ACCEPTĢ5) iptables -P INPUT DROP – Drop all other connection attempts. The DNS should be set to that of the ISP on the internet. 192.168.1.10 change with your own gateway # Change 61.5.156.146 with your Gateway IP AddressĪll PC’s on the private office network should set their “gateway” to be the local private network IP address of the Linux gateway computer. # Delete all chains that are not in default filter and nat tableħ) iptables –table nat –append POSTROUTING –out-interface eth0 -j MASQUERADEĨ ) iptables –append FORWARD –in-interface eth0 -j ACCEPTĩ) echo 1 > /proc/sys/net/ipv4/ip_forwardġ1) route add -net 192.168.1.0 netmask 255.255.255.0 gw 61.5.156.146 dev eth0
![linux router configuration linux router configuration](https://3.bp.blogspot.com/-peke76gt-wo/Uo7pDIYYeII/AAAAAAAAApo/3Teg6vx8BNU/s1600/router.png)
![linux router configuration linux router configuration](https://i1.wp.com/systemzone.net/wp-content/uploads/2018/01/Web-Server-Configuration-in-CentOS.jpg)
Others like “nat” must be explicitly stated.ģ) iptables –flush – Flush all the rules in filter and nat tables I) Copy and paste the configuration file of the eth0 with a new name eth0:0Ĭ) Assign a private IP Address like you have assigned the other computers in your local area networkĢ) Creating forwarding rules with iptables: DNSī) Create a virtual IP address on this Fast Ethernet Card V) Preferred DNS (203.143.22.22) change with your preferred DNS Iv) Default Gateway (61.5.156.146) change with your Default Gateway Iii) Net Mask (Provided by the Internet service provider) (255.255.255.248) change with your net mask
![linux router configuration linux router configuration](https://www.researchgate.net/profile/T-Yang/publication/234783058/figure/fig4/AS:339696317157388@1458001321676/Configuration-of-a-Linux-Router.png)
Ii) IP Address (61.5.156.1) change with your public IP address