Tuesday, October 6, 2020

IP Masquerading and network cards

Hi. I am a second year information systems student. I got an exercise from my university but i am struggling to understand how to complete it, and with covid and not having in person teaching (and tutors and lecturers who dont respond) its taking its toll. I will attach a link to imgur to see the way the requirements are stated.

I need to allow specific traffic on a specified card, with a specified address among other things. All of the filtering requirements for c i understand how to do. eg sudo iptables -A INPUT -j ACCEPT -m conntrack --ctstate ESTABLISHED,RELATED but i am unsure of how to apply a rule like this to "incoming traffic from the internet". I understand it has to do with the network cards. I have seen lots of things add the " -i eth0" part to specify incoming traffic to eth0 (the external card) but how to i specify that the address of the external card is 192.51.100.42 ? i also thought to add something like " -d 192.51.100.42" which i think means allow all established connection traffic where the destination is 192.51.100.42 (my external card). Which of these satisfy the question, if any?

I also thought it had to do with editing the rules in the nat table, but i cannot edit the policies there. So i cant "block all traffic save for xyz" as that takes place in the filter table. I could just do the rules and add " -i eth0" like i said but since the question gives me the ip address of eth0 i assume i first need to specify it. I also saw on a website to use sudo vim /etc/network/interface but the vim command is not allowed on my linux ubuntu virtual machine.

How would i go about accomplishing the questions b and c? Any help will be appreciated.

link to image to see the way the questions are stated: https://imgur.com/FmESOCe



No comments:

Post a Comment