Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Your Linux server can act as a Firewall , Proxy Server,DHCP server , Windows Sharing Server, any VPN application and port forwading to any of the internal machines.
I think you have 3 options to setup a network
First Option
The Linux Server could be linked to router and from the Linux to the switch and connect all the workstations to the Switch.( Linux server should 2 Lan Card )
Second Option
Connect your Modem / router to the Switch and All the workstations including the Linux server is connected to the Switch
Third Option
Linux itself can act as router so that you can connect the Linux to modem from Linux to Switch and all other workstations to the switch, but network applications are highly susceptile for network attacks So firewall in Linux should be tailored strong and rigid
(Linux server should have 2 Lan card )
The Second option could have a performance drop in
network aspect.
Please let me know if your need further help
Regards
Now everything is working like philex's second option, but I want switch it to philix's first or third option. I know how to setup DHCP, samba, apache, but I need some help with routing table, ethernet cards configuration, dns, ssh, firewall. Also I want switch distribution from Fedora Core 3 to Debian.
Linux can act as router if configured its various parameters,
route -n [ Displays the present details of routing table ] route add default gw <GW IP Address> will inform the Linux server the external host it has to contact to access internet. The workstations should have its gateway configured to the internal IP address of the linux server. While the <GW IP Address> of the linux server should be the IP provided by your ISP.
Routing & Nat using iptables.
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Implementing the forwarding Permanently
edit /etc/sysctl.conf
change the net.ipv4.ip_forward = 1
DNS
Do you want this Linux server to be DNS client or server ?
If it is DNS client , you should edit the /etc/resolve.conf
with an entry like
nameserver <DNS IPaddress>
nameserver <DNS Second IPAdress>
DNS server configuration is a long process, Please confirm whether you need the DNS server.
SSH
Please disable the Permit root entry to NO in the sshd_config
Allow only certain users to remote login the SSH, who username is to be little complicated and password to be mixture of alphanumeric characters.
Disable SSH protocol 1 which is a buggy one
Ethernet card can be configured from the ifconfig command or by editing the /etc/sysconfig/networking-scripts/ifcfg-eth0 or ifcfg-eth1
ethtool and mii-tool command gives the link status and Card HW configuration details.
Debian is considered much more stabler and debugged as soon as bugs are informed as lots of Linux lovers are genuniely working on it.
You can find the SSH configuration file under /etc/ssh/sshd_config
Comment the Host Key of the Protocol version 1
Port 22
Protocol 2,1
ListenAddress 0.0.0.0
#ListenAddress ::
# HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
Place the value No for the gievn below entry PermitRootLogin No
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.