We help IT Professionals succeed at work.

Linux mapping nätverk ports

Handersson75
Handersson75 used Ask the Experts™
on
Dear expert

I wonder if this is possible to do and if its possible I need to know the tutorial of it, thx.

Im currently setting up and Debian linux system and planning using it as a firewall/VPN server. I only have one problem, the computer is a old laptop and it only got one network card.

Here is what I thought, to plug the laptop with a hub/switch and use those hub/switch to plug into internet/lan cable and mapping those ports from switch to firewall/VPN settings, is it possible to do? So for exemple: Hub/switch port2 is outside, port3-4 is inside. and also apply the rules to those?

Thx.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Just a thought, if its not possible, then its might to possible to doing it in VMware to create virtual network cards and mapp those to hub?
Sikhumbuzo NtsadaIT Administration

Commented:
You should be able to set up a secondary IP address on that 1 NIC by editing your network interface:

auto lo
iface lo inet loopback

auto eth0 eth0:0
iface eth0 inet static
    address 10.1.1.2
    network 10.1.1.0
    netmask 255.255.255.0
    broadcast 10.1.1.255
    gateway 10.1.1.1
    up route add default gw 10.1.1.1
    down route del default gw 10.1.1.1

#Second IP same NIC

iface eth0:0 inet static
    address 192.168.1.2
    network 192.168.1.0
    netmask 255.255.255.0

Open in new window



...you can then map traffic and gateways according to your plan.

Author

Commented:
thx for answering

what happens if I want to add more interface to the laptop? like wireless APs and clients? I still need a hub/switch tho.
Sikhumbuzo NtsadaIT Administration

Commented:
You should be able to add a wireless adapter if that's what you meant, you would need to add drivers for it.

You can add at least 2 virtual interfaces on that LAN port on your laptop, that are readily available to be use by your switch/hub.

And yes you will need a switch/hub for your clients.

Author

Commented:
thx for the answer again, is there any tutorial of how to do it, to map the network ports from hub/switch to debian console?
Sikhumbuzo NtsadaIT Administration

Commented:
Depending on your level of Linux knowledge, this might be tricky:

Here is a link to set up OpenVPN on Debian Linux.


http://wiki.debian.org/OpenVPN

Author

Commented:
beginner level, I want to map the port from switch/hub to laptop, is there any tutorial for that?
IT Administration
Commented:
For that you would need the IP address of the switch/router, for example:

http://192.168.0.1
Username:admin
Password:admin

Depending on what router you are working with (most switches are unmanaged and you will not be able to map ports)

It involves creating a port and assigning it it to a protocol  ( PPTP and L2TP/IPSec VPN ports) then point it to the IP address in the Laptop.

So you will need the name of the router you will be using for detailed information.

Author

Commented:
thx